ANE-MultiPeerConnectivity is a native extension to detect nearby iOS7 devices and send them messages. The extension has two main parts: an assistant (to help being discovered) and a discovery helper (to help discover). Both assistant and discovery helpers can be started and stopped using a simple call from the extension singleton.
When a device starts a helper, it must specify a service type. That type is a unique identifier, and should be the same for discovery and assistant. It’s also possible to set the peer name, which is the device unique identifier. After the discovery starts, an event is fired for each peer found.
Sample
AirMultiPeerConnectivity.getInstance().startAssistant(serviceType, peerName); AirMultiPeerConnectivity.getInstance().stopAssistant(); AirMultiPeerConnectivity.getInstance().startDiscovery(serviceType, peerName); AirMultiPeerConnectivity.getInstance().stopDiscovery(); AirMultiPeerConnectivity.getInstance().addEventListener(AirMultiPeerConnectivityEvent.FOUND_PEER_EVENT, onPeerFound); private function onPeerFound(event:AirMultiPeerConnectivityEvent):void { var peerName:String = event.peerName; }