According to Apple’s documentation, Bluetooth related app can assign a restore identifier to itself so that it can be re-launched by system when BLE events arrived and the app has been killed by System. I made a test on this and found some facts Apple didn’t describe it clearly.
- If the app got killed by system due to resource limitation, it exactly can be re-launched, as Apple’s Core Bluetooth Programming Guide described.
- If the app got killed by user sliding up the app card away, it won’t be relaunched
- If the app connected to a bluetooth peripheral, it looks like the system assigned it a high priority so it is unlikely to be a candidate when system needs killing something.
- After centralManager:willRestore: method, centralManager:didUpdateState: is always got called, so let the latter handle both the cases of normal launching and re-launching by system is OK.
Therefore, there is still no safe way to handle BLE communications in background since user can always kill the app, and it is usual for us iPhone users.