Multipeer Connectivity in iOS 10 (Bluetooth Issues)

I have an app that has been in production for 3 years. It uses MPC to connect remotes (iphones/ipods) to an iPad for sports scoring.


In testing with iOS 10 (now on GM), I have come across the following issue:


The app works fine when all devices are on using WiFi only, i.e. everything connects. When I put all devices into Bluetooth only, I get a connect failure.


Here is my invitation code:


[_servicebrowser invitePeer:peerID toSession:_session withContext:nil timeout:30];


Here is my connection code on the iPad:


  1. -(void)advertiser:(MCNearbyServiceAdvertiser *)advertiser didReceiveInvitationFromPeer:(MCPeerID *)peerID withContext:(NSData *)context invitationHandler:(void (^)(BOOL, MCSession *))invitationHandler
  2. {
  3. if (_serverState == ServerStateAcceptingConnections && [self connectedClientCount] < self.maxClients)
  4. {
  5. NSLog(@"MatchmakingServer: Connection accepted from peer %@", peerID);
  6. invitationHandler (true, _session);
  7. }
  8. else
  9. {
  10. invitationHandler (false, _session);
  11. }
  12. }
  13. -(void)session:(MCSession *)session didReceiveCertificate:(NSArray *)certificate fromPeer:(MCPeerID *)peerID certificateHandler:(void (^)(BOOL))certificateHandler
  14. {
  15. certificateHandler (true);
  16. }


Here is the issue:


When using WiFi (Bluetooth turned off on all devices), the didReceiveCertificate method is called and passes as usual. When using only Bluetooth(WiFi off on all devices), this method is never called and the console gives the following message:


Advertiser got invite with nil connectionData.

Data from peer [Steve's iPhone,09D0CE9E] received with error Connection closed.


The connection then fails.


This is a huge problem for me as my clients rely on Bluetooth connectsion as well as WiFi.


What has changed???? The exact same code is being executed for WiFi or Bluetooth.

I am having the same problem! If you turn WIFI off and only have bluetooth on, I get exactly the same problem as you.

Will check my console as well. My code also works with iOS9.

Update: Have tried with Encryption set to None and same results.

I have the same problem *without* using MultipeerConnectivity. I publish my service via Bonour manually, using <dns_sd.h>, and then connect a TCP socket over Bluetooth. This works fine iOS 9, and does not work in iOS 10 -- at the socket level, I get a timeout on trying to connect. ARGH all of my customers are going to have a broken app come tuesday... and i have no idea how to fix it. (Edit: earlier I had written that it *sometimes* works, but after looking back at the logs, that was when wifi was on and it was using wifi not bluetooth).


Please let me know if you make any head way on this. Even if you're using MPC.

I think it's time for a bug report.

I did report this:

Bug report: 28218002


It may be time for a support request.

Hi all,

I managed to solve my dns_sd issue by reading the discussion this thread here: https://github.com/tolo/HHServices/issues/17

It turns out that iOS 10 appears to block IPv4 connections, at least it blocks IPv4 if an IPv6 address is available for the host.

So if you are having problems, then check if you can substitute IPv6 addresses instead of IPv4. That worked for me.

Good luck!

Thank you for posting this. However, I'm using MPC. How can I control the addresssing within MPC?

Also...I'm trying to connect ios10 to iOS 10, but ios10 to ios9 doesn't work either.

Just tested his with iOS 10.1 Beta 1: same result. MPC will not connect over Bluetooth. Anyone else seeing this using MPC? Does anyone have it working???

Worse is that this is what happened with my bug report


Engineering has determined that your bug report (28218002) is a duplicate of another issue (28300004) and will be closed.

And the other one just says Open

I'm having exactly the same issue with my app that relies on MPC via bluetooth.


Has anyone got any response from Apple? If so, are they working on a fix? It is pivotal my App is up and working again by the november.

I too am having this issue.


1. Works when both devices are on WiFi.

2. Fails with error "Advertiser got invite with nil connectionData." when both devices are on bluetooth.

3. Have tried it with Deployment target 8.0. Didn't work.

4. Have tried it with Deployment target 10.0. Didn't work.

5. Tried with no encyption (as below). Didn't work.

session = [[MCSession alloc] initWithPeer:localPeerID securityIdentity:nil encryptionPreference:MCEncryptionNone];


Anyone have any ideas if there's anything we can do to resolve this or if we have to wait for Apple to fix the bug?


Thanks

Any updates from Apple on this bug request?

Same issues here.. Only over bluetooth... Works when both devices are on wi-fi...


[ViceroyTrace] [ICE][ERROR] ICEStopConnectivityCheck() found no ICE check with call id (380236955)

[MCNearbyServiceAdvertiser] Advertiser got invite with nil connectionData.

I am finding iPhone 7 Plus BLE and BT generally not as reliable as previous products. Handoff to certain machines fails, audio streams stop, etc.

Multipeer Connectivity in iOS 10 (Bluetooth Issues)
 
 
Q