When are background refreshes allowed to execute?

The documentation states:


"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."


Does this mean that applictions are woken up to refresh in the background even if the user haven't explicitly started them yet, but also (obviously) haven't force quit them? I.e. if a user reboots their phone, but doesn't launch my app, is it going to be able to refresh?

if a user reboots their phone, but doesn't launch my app, is it going to be able to refresh?

The “has the user launched this app” flag persists across restarts.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thanks. 🙂 What confuses me in the documentation is exactly this. Because it basically says that users must launch the app OR reboot their device before the app can be lanched automatically. So now my question is: can apps be launched automatically in the background for which the “has the user launched this app” flag is set to false? What are the exact conditions in which an app can and will be launched in the background?

So now my question is: can apps be launched automatically in the background for which the “has the user launched this app” flag is set to false?

Yes. There’s a long history to this issue. The original plan was for apps to never launch automatically when that flag was clear. In iOS 4 through 6 that was the plan but there were various bugs that allowed this to happen. In iOS 7.0, IIRC, we got everything consistent, so once you terminated an app from the multitasking UI it would never launch again until you manually launched it. In later versions of iOS 7.x we backpedalled on that a bit, although I don’t recall the exact details.

What are the exact conditions in which an app can and will be launched in the background?

The exact conditions are not documented because they are not considered API.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

How does Apple define a "location app"?

This is covered quite comprehensively in the Tracking the User’s Location section of the App Programming Guide for iOS (just click the link you posted and search for section title). Please read that and then post back on this thread if you find any of it unclear.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
When are background refreshes allowed to execute?
 
 
Q