Instead of using the MCBroswerViewController, you can use the MCNearbyServiceBrowser. Then it will call the delegate method:
- (void)browser:(MCNearbyServiceBrowser *)browser foundPeer:(MCPeerID *)peerID withDiscoveryInfo:(NSDictionary *)info;
Then you can automatically send an invitation with something like:
[browser invitePeer:peerID toSession:self.session withContext:nil timeout:10]
However, I encountered many other problems. So far it seems:
- If both devices send invitations and accept them, they quickly turn off.
- If both devices advertise and broadcast at the same time, they are randomly turned off.
I am currently working on an open source library to try to accomplish exactly what you are asking for: connect devices without any prompts or browser (without an interface).
Here it is: https://github.com/plivesey/PLPartyTime
However, it does not work yet. I have not completely resolved both questions above, but if you want to check the code and see what you can solve, go for it. Please let me know about any progress you are making. This structure is disappointing ...
plivesey
source share