Detect many devices - peers using Multipeer Connectivity

Hello there! I am developing an application with which I want to locate nearby iPhones through the Multipeer Connecvitity protocol and communicate with them. I have two questions regarding the MC protocol.


First, can I (somehow) get the distance between the other iPhones and my device (with Bluetooth LE signal), the same way I would do so using the iBeacon technology?


Second, I read somewhere that each MCSession has a limit of 8 peers. Is that true? See, I want my application to be able to detect many peers (as many as possible around me - since they have the same app installed and running). How could I resolve this, in case one MCSession has an 8 peer limit? Could I initiate multiple MCSessions, with my device as the only common peer in each one?


I would be really gratefull if someone could help me figure these out! Thank you in advance!

First, can I (somehow) get the distance between the other iPhones and my device (with Bluetooth LE signal), the same way I would do so using the iBeacon technology?

No.

Second, I read somewhere that each

MCSession
has a limit of 8 peers. Is that true?

There’s certainly a limit. I don’t remember what the current value is, but you can get it by printing

kMCSessionMaximumNumberOfPeers
.

See, I want my application to be able to detect many peers (as many as possible around me - since they have the same app installed and running)

It sounds like using Bonjour directly would be a better match for your requirements. Check out

NSNetService
and it’s
includesPeerToPeer
flag. Or the new Bonjour browser support we just announced for the Network framework.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thank you eskimo! I will look into it! However, I will try to build and "trigger" a multiple mcsession scenario. Afterall, the Multipeer Connectivity protocol is based on Bonjour 🙂 Thank you again!

Detect many devices - peers using Multipeer Connectivity
 
 
Q