I’m attempting to build a multi peer network app and I’ve got everything working for a single conversation between two users however the intention was to build a master- -> detail app like whatsapp where you have a list of conversations and tapping one takes you to the conversation. The problem I’m having is all the housekeeping in maintain multiple sessions.
My structure is that I have a ‘conversation manager’ which has an array of ‘conversations’ which are wrappers for an MCSession that have an array of messages. When a conversation is started (either by inviting a recipient or by accepting an invitation) the conversation object(session) is added to the array, which is the data source for the master table view. When a conversation is selected from the list, in prepare for segue I pass the conversation object to the detail view controller and it’s array of messages become the data source for the detail screen.
I’m having numerous issues trying to get this working, such as messages not being delivered in conversations currently not on screen, keeping all the sessions active, not allowing multiple separate conversations between the same two people etc.
My specific question is that, most of the examples and tutorials, including Apples sample app focus around one conversation, one active session at a time. Am I wasting my time trying to get this working. Ie. Was the framework only designed to accommodate a single active session at a time?
I ran into this curious about the same thing!
I realize this is nearly 3 years old but here's a thought: If you're using MPCF then you're accepting that these chats are within wifi/bluetooth range. Well, you could accept the limitation of one session at a time and the limitation of up to 7 active chats at any time. You and seven others? 1:1 Then you can just pair those chats up. Each peer could have 7 threads. We can assume that only 8 people have your app open and are within range? I realize this doesn't -completely- solve your problem but it hopefully it gives some direction since I'm not sure another option is possible.
And no answer/help for three years kinda stinks so I'm hoping to pitch in!
If you did find a better answer I'd love to know what you found!