IOS Under what conditions does Core Bluetooth work?

I use state save and restore. After simulating the memory pressure with kill(getpid(), SIGKILL); the application will be killed and then woke up, I receive notifications from CBCentralManagerDelegate , and I can communicate with peripheral devices.

If restoration works after:

  • Rebooting iOS?
  • user removes application from multitasking panel?

According to such messages: Long-term actions after the application is killed , paragraph 2 is impossible.

  1. If recovery does not work for 1 or 2 points, how can I β€œrestore” my peripherals in these situations?
+5
source share
1 answer

Restoration works when the application is destroyed by the OS:

  • call kill(getpid(), SIGKILL)
  • OS kills in the background

In other cases, the application is not restored. The reason for this is probably the intention that the user wants to kill the application, so it should not be restarted. This might not be the case for a reboot, but Apple still considered it that way.

So far, no reports have shown changes in iOS 8 regarding reboot after reboot.

It is impossible to restart after starting the taskbar, but there is an alternative solution to reboot. You can register for significant location changes that will be restored after a reboot. This worked for me very reliably.

+7
source

Source: https://habr.com/ru/post/1203710/


All Articles