iosobjective-ccore-locationregion-monitoring

iOS background wake on password protected device


In Apple Doc Understanding When Your App Gets Launched into the Background says

When password protection is enabled on the device, the system does not launch an app in the background before the user first unlocks the device.

Users cannot keep unlocking there iPhones after every few minute that some app will wake in background.

How an region monitoring app will wake in background and do its stuff when an password protected device will not let the app launch in background?

What is the meaning of that is written in Apple doc?


Solution

  • I think you misunderstood the documentation.

    In most cases, the system does not relaunch apps after they are force quit by the user. One exception is location apps, which in iOS 8 and later are relaunched after being force quit by the user. In other cases, though, the user must launch the app explicitly or reboot the device before the app can be launched automatically into the background by the system. When password protection is enabled on the device, the system does not launch an app in the background before the user first unlocks the device

    So what it means is that if the user force quit your app on a password protected iPhone:

    1. If this is a location service => User must unlock the phone before a background operation can be executed

    2. If this is not a location service => User must unlock AND launch the app once before background operation can be executed.

    In any case, once the app has been launched once, background operation can be triggered.