I have two apps which are successfully utilising multipeer connectivity to send messages.
Currently, when the "server" app moves to the background, I tear down the session and re-establish when returning to the foreground. Now, I need to make the server app responsive (to received messages) while in the background.
By being responsive, I mean can accept an incoming message, do the processing and return an acknowledgment to the peer - no UI required. When the App returns to the foreground, the messages received while in the background will be displayed.
I've disabled the MPC teartown on background notification and found that MPC automagically disconnects the "server" from the session - so my "client" peers see the server go offline.
- Is a background multipeer session possible? I assume it is, but can't seem to find anything definitive on how I would enable it.
- I've not developed an app that supports background processing, so I'm looking for guidance whether an app that supports background processing will solve the problem
- The supported background modes I've seen don't really align to multipeer - the closest I can find is "background fetch" - does it really matter?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…