Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does location update remain running after force close app

I am sending user location at n time on server for tracking. Working fine in foreground and background mode. But my question is bit more theoretical.. Does my location update service remain running after i force close the app on the device?

I know i can check it on server, But sorry i don't have server access permission. So i have to be sure in which scenario my location service will stop running.

like image 533
Dilip Avatar asked Jun 02 '14 04:06

Dilip


People also ask

Does iPhone location always update?

From iOS 13, the “Find My” app automatically updates the shared location status after every minute. However, if you want, you can manually update the location status as well.

Will iOS terminate the app running in background after a specific time?

iOS places strict limits on how long a background task can run, and if the EndBackgroundTask call is not made within the allotted time, the application will be terminated. By keeping track of the remaining backgrounding time, and using expiration handlers when necessary, we can avoid iOS terminating the application.

Do apps track location in the background?

Although location tracking is an essential feature for many apps and services, it can be pretty invasive when apps indiscriminately ask for location access. Background tracking is even worse, because it means that you might be completely unaware of which apps on your phone are tracking you at any moment in time.


3 Answers

Yep it will continue to be updated when the application is sent into the background. For some official docs check here under the "Getting Location Events in the Background (iOS Only)" section.

Also, under special circumstances you can register your application to have a true background process running like Android allows. So when the user kills the background application, your app doesn't really die. The background process continues to work. Apple will only allow apps that have a necessary reason for this though. Such as a turn by turn navigation app (example from the docs).

like image 53
JoshA Avatar answered Sep 28 '22 22:09

JoshA


Yes, if the application is removed from background then location update will be stopped.

like image 39
Rahul Mathur Avatar answered Sep 28 '22 22:09

Rahul Mathur


iOS will only restart an app after a force close if its uses region monitoring or the significant-change location service. From the iOS Location and Maps Programming Guide section on Getting the User’s Location:

If your app is terminated either by a user or by the system, the system doesn’t automatically restart your app when new location updates arrive. A user must explicitly relaunch your app before the delivery of location updates resumes. The only way to have your app relaunched automatically is to use region monitoring or the significant-change location service.

iOS only restarts the app if it has Background App Refresh enabled:

when a user disables the Background App Refresh setting either globally or specifically for your app, the system doesn’t relaunch your app for any location events, including significant-change or region monitoring events.

like image 24
Edward Brey Avatar answered Sep 28 '22 21:09

Edward Brey