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.

It looks like 10.1 Beta 2 fixes the issue! 🙂

Instead of upgrading to beta version 10.1 Beta 2, is there any workaround to solve this issue? 😢


I got the same error by using MPC.


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

I just tested it with iOS 10.1 Beta 4. 😟

But it still doesn't connect on Bluetooth-Only, at least not to another device with iOS 9.3.5.

Problem (Only bluetooth connectivity) still exits after iOS 10.1 release. Is there any workaround for this? I am looking at enterprise application which need not be in appstore.

So even if the workaround is using unpublished system component/library, we are ok using it.

I am also getting this issue on my test app between Mac OS X Sierra running on a MacBook Pro and iOS 10.1 running on an iPhone 5c, but I'm getting it even over Wi-Fi.


On the OS X side, I'm getting: [ViceroyTrace] [ICE][ERROR] ICEStopConnectivityCheck() found no ICE check with call id (309651737)

and it loses connection.


On the iOS side, I'm getting: [AGPSession] Couldn't check in handle iDstIDs (0).

as well as [GCKSession] Not in connected state, so giving up for participant [5F2C221B] on channel [0]

Have tried all the various suggestions above (e.g. authentication)

Does anyone have updates of this issue ?

If you had, could you share it with us ?

Seconded. I am having the same issue still. Wondering if there is a fix coming soon?

I actually had implemented a stub for a method and when I deleted it, the app started working for me again.


http://stackoverflow.com/questions/34393372/multipeer-connectivity-framework-not-connecting-anymore


Thank you for your information!!

I remvoed "session:didReceiveCertificate:fromPeer:certificateHandler" method from my code as your link page describes, however, it still doesn't work.


Could you tell me which ios version you are using for ?

Does your app working even when Bluetooth only ?


Thank you.

I have found out new info.

I am using two iPhones (iOS 10.2).

I started advertising and browsing in "applicationDidBecomeActive" method in AppDelegate file before and it didn't work for multipeerconnectivity.

The connectivity is unstable.

When I started them in "viewDidAppear" method in the view controller file of first launching view, it worked perfectly even when wifi is off (bluetooth only) !!

I don't understand why it works well...

I hope this info is beneficial for you.


Thanks.

Multipeer Connectivity in iOS 10 (Bluetooth Issues)
 
 
Q