Is it possible to use the Multipeer Connectivity framework for a messaging service? For example a user provides permission for the application to occasionally run in the background like other apps so that the application can forward messages and data to the intended recipients. I am under the impression this is how the Find My network behaves so I was curious if similar functionality could be achieved with this framework. Or is the Multipeer Connectivity framework solely for user-centric activities where sessions must be started and maintained with foreground app usage.
Peer to Peer connectivity
Is it possible to use the Multipeer Connectivity framework for a messaging service?
No in the way that you’ve defined it. Multipeer Connectivity doesn’t contain any background execution superpowers. If your app is suspended in the background, networking stops just like it does for most other networking APIs. See Technote 2277 Networking and Multitasking for some (old but still relevant) backstory here. Also, iOS Background Execution Limits.
Messaging services like this are usually implemented using push notifications.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"