Multipeer Connectivity: getting an invitation accepted (using built-in browser VC)

后端 未结 3 1235
死守一世寂寞
死守一世寂寞 2021-01-12 18:07

I\'m trying to follow the WWDC talk to learn about the MultipeerConnectivity framework. After many false starts, the browser(s) show the peers, and invitations get issued.

3条回答
  •  借酒劲吻你
    2021-01-12 18:36

    I've not gone the MCBrowserViewController route myself when working with the new MC framework, but from slide 51 of the WWDC presentation, it does look like the browserViewControllerDidFinish: is only called when the user presses done. So this callback is probably not where the problem lies if your peer is still showing up as "Connecting...".

    I'm wondering if you have to connect your peers to a session manually. You're already setting the MCSession delegate, so I'm assuming you're implementing session:peer:didChangeState. Set a breakpoint and watch for when MCSessionState is MCSessionStateConnected. The only thing I'm unsure of is if you need to manually handle this on the advertiser side, the browser side, or both. If you could figure out at which step the framework stops handling it, that would be helpful.

提交回复
热议问题