29 Replies
      Latest reply on Jun 5, 2017 3:20 AM by ipatde
      smcarther Level 1 Level 1 (0 points)

        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:

         

        1. [_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.