iOS BLE application restore

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.

  1. 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.
  2. If the app got killed by user sliding up the app card away, it won’t be relaunched
  3. 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.
  4. 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.

Leave a Reply

Your email address will not be published. Required fields are marked *