Is it possible to fetch the user's latitude and longitude after the app has been manually terminated? If so, could you please provide a solution?
Background Location Update
No, it is not possible to fetch the user’s latitude and longitude after the app has been manually terminated by the user (i.e., the user swipes the app away from the app switcher). This is a strict limitation imposed by iOS for privacy and security reasons.
Check the link :- Apple Developer Documentation
On iOS, an app is in use when it’s in the foreground and for a short time when it transitions from the foreground to the background. If you enable background location updates, an app with When in Use authorization continues to run in the background when location services are active; if location services aren’t running, the normal suspension rules apply. If the system terminates the app or the app isn’t running, the system doesn’t launch an app with When in Use authorization to deliver new updates; it does launch an app with Always authorization for some types of location updates
Hey there,
I think that maybe there's a way if you took a look at the new Location API's Apple released last year,
I think this might work even if app is force killed, but check the docs and wwdc videos, I'm not sure
I think that maybe there's a way if you took a look at the new Location API's Apple released last year,
I believe that allows you to resume if the app crashes in the background, but not if the user has deliberately terminated it.
Edit: though that's not what Argan Tekant says in this thread: https://developer.apple.com/forums/thread/763166 and I guess they're probably right. I find it surprising though.
The new CoreLocation APIs will indeed relaunch apps for both low accuracy and high accuracy location services, as long as the app has acquired Always location authorization.
I would suggest to watch the WWDC videos about these new APIs
Discover streamlined location updates
What's new in location authorization
Argun Tekant / DTS Engineer / Core Technologies