简体   繁体   中英

Peer (MultiPeer Connectivity) is connected but not stored in connectedPeers

I have one device that is advertising itself to 2 other browsers. Once both browsers connect to the advertiser for the first time, everything works well (each peer is connected with one another).

Once browser 1 disconnects and reconnects, browser 2 no longer has browser 1 as a connected peer even though they are connected according to peer:didChangeState:. However, the advertiser successfully has 2 connected peers. Any ideas what could be wrong or how I could further debug this?

(Note: I'm using MCNearbyServiceAdvertiser and MCNearbyServiceBrowser and creating my own custom advertiser/browser view controllers)

Just found a fix!

Initializing a new peerID, browser, and session (using the new peerID) before reconnecting fixed it for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM