Search code examples
iosexitmultipeer-connectivitydisconnectmcsession

Disconnecting a session without exiting the app


Iam using Multipeer connectivity Feature.

Consider A,B,C are connected in a session created by A.Suppose B want to get out of the session without disconnecting the session ( [session Disconnect] ) or exiting the app .Is that possible?. Does turning off the advertiser of B,disconnects it from the session?. Or is there any other way? Please help!


Solution

  • The Apple sample application for the MCMultipeerConnectivity framework contains the use-case you describe.

    They create a wrapper class to handle the MCSession, and each MCSession maintains an array of connected MCPeerIDs.

    Source: https://developer.apple.com/library/ios/samplecode/MultipeerGroupChat/Introduction/Intro.html