简体   繁体   中英

Multipeer Connectivity in background mode

I have implemented an iOS app that uses MPC to send data to an OS X app. After the MPC session is established, data is being transferred with no issues. However, when the iOS app goes into background mode, after a while it looks like the session is getting disconnected.

Please note the following facts:

  1. The iOS app is set to be working on background as it also doing some BLE tasks, so I know for sure that the iOS app is running with no issues even when in background mode (I made sure it does not go into suspended mode at any time).
  2. I am aware of the Apple docs that states that MPC will get close once app goes into background mode.

If the app moves into the background, the framework stops advertising and browsing and disconnects any open sessions. Upon returning to the foreground, the framework automatically resumes advertising and browsing, but the developer must reestablish any closed sessions.

My question is, is there any workaround that will keep my MPC alive even when app is in background mode?

UPDATE: I could not find a workaround for that. I ended up using pure BLE.

不,不幸的是,没有解决方法可以在应用程序处于后台模式时保持 MPC 会话处于活动状态。

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