/MCTransceiver

iOS library providing an abstracted interface to the Multipeer Connectivity API

Primary LanguageObjective-CMIT LicenseMIT

MCTransceiver

iOS library providing an abstracted interface to the Multipeer Connectivity API

Features:
Using
  • Clone repo (or download ZIP file)
  • Drag & drop ABTools.xcodeproj into your workspace
  • Follow Apple's documentation on how to use static libraries in iOS

The library uses ARC. It has been developed using Xcode 5 & tested against iOS 7.x.

Documentation

The Xcode project includes a Documentation target which can be used to generate documentation for the API. It requires the use of appledoc. Once you've built the documentation it will be available through Xcode's Documentation window.

The latest HTML documentation is also available.

Examples

The Examples folder includes a the MCTransceiverExample project that demonstrates communication between two iOS devices: one acting as the advertiser (host) the other as the browser (join).

Advertising, Browsing and Sending Data
  • While this API is presented through a single interface -- MCTransceiver -- the tasks of advertising and browsing are provided separately, through the startAdvertising: and startBrowsing: methods.

  • Currently the only way to send data from one device to another is through the sendUnreliableData:toPeers:completion method. From the documentation, sending data unreliably means:

Messages to peers should be sent immediately without socket-level queueing. If a message cannot be sent immediately, it should be dropped. The order of messages is not guaranteed.

  • Future additions to this API will provide the ability to:
    • Send reliable data (guaranteed, in-order delivery, retransmitted as needed)
    • Send a resource based on URL to a peer
    • Stream data to a peer