Niklas Raab
Niklas Raab

Reputation: 1736

iOS background location tracking after reboot

Imagine i am setting up a location background task, for my iOS app, to track the users location. The user granted my app access to his location "Always". Does this mean, the background tasks runs only when started from the app, until the phone ist shut down, or does this mean, that the location background task is restarted after rebooting the os?

Upvotes: 1

Views: 191

Answers (2)

KingHodor
KingHodor

Reputation: 547

A task has to belong to a process. If the thread's process does not work, the thread can not work. So, the answer is the first, the background task runs only when started from the app. Because your background task belongs to your app that means your process.

You have to create a system thread if you want it to work even if your process kills. But, most operating systems do not allow the user to do if you do not develop a device driver.

Upvotes: 0

Woodstock
Woodstock

Reputation: 22926

It means you have access to location services even when the app isn't in the foreground. However, you must have some active task such as navigation in process.

The Always API function isn't tantamount to constant background execution.

Upvotes: 1

Related Questions