Latest 0.1.1
Homepage https://github.com/gupuru/StreetPassBLE-iOS
License MIT
Platforms ios 8.1, requires ARC
Authors

header

StreetPassBLE すれ違い通信

iOS’s StreetPass Communication library

What is StreetPass Communication?

StreetPass is a Nintendo 3DS functionality which allows passive communication between Nintendo 3DS systems held by users in close proximity, an example being the sharing of Mii avatars in the StreetPass Mii Plaza application, and other game data. New data received from StreetPass is indicated via a green status light on the system.

Wiki

About this library

When the terminal with each other has become close to, it is capable of transmitting and receiving data of about 100 bytes.

8.1 is available in more than.

Questions and requests is here.

Animation

CocoaPods

pod 'StreetPass'

Usage

Please add the following to the info.plist.

<key>Required background modes</key>
  <array>
       <string>App communicates using CoreBluetooth</string>
       <string>App shares data using CoreBluetooth</string>
  </array>

Start StreetPass

let street: StreetPass = StreetPass()
street.start()

Settings

  • UUID
  • Transmitted data
let street: StreetPass = StreetPass()

let streetPassSettings: StreetPassSettings = StreetPassSettings()
                .sendData(sendData)
                .allowDuplicates(false)
                .isConnect(true)

street.start(streetPassSettings)

Stop StreetPass

Please stop sure.

let street: StreetPass = StreetPass()
street.stop()

Delegate

Received data.

func receivedData(receivedData: ReceivedData) {
  //received data
}

Error

func streetPassError(error: NSError) {
  //error
}

Sample

class ViewController: UIViewController, StreetPassDelegate {

let street: StreetPass = StreetPass()

override func viewDidLoad() {
  super.viewDidLoad()

  street.delegate = self
  //start
  street.start()
}

override func viewDidDisappear(animated: Bool) {
     super.viewDidDisappear(animated)

     //stop
     street.stop()
}

func streetPassError(error: NSError) {
  //error
}

func receivedData(receivedData: ReceivedData) {
  //received data
}

License

The MIT License (MIT)

Copyright (c) 2016 Kohei Niimi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Latest podspec

{
    "name": "StreetPass",
    "version": "0.1.1",
    "summary": "StreetPass library.",
    "homepage": "https://github.com/gupuru/StreetPassBLE-iOS",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "platforms": {
        "ios": "8.1"
    },
    "authors": {
        "gupuru": "[email protected]"
    },
    "source": {
        "git": "https://github.com/gupuru/StreetPassBLE-iOS.git",
        "tag": "0.1.1"
    },
    "source_files": "StreetPass/*",
    "social_media_url": "https://twitter.com/gupuru",
    "requires_arc": true
}

Pin It on Pinterest

Share This