Reputation: 59
I'm making an app where I am showing the User's distance from other users. I'm able to update user locations when app is open and when app is in background HOWEVER I can not figure out how to update the location when app is terminated. I have been told that this is not possible but I believe it is possible because Life 360, Facebook, etc update the location in terminated state. Any help on how to achieve this is greatly appreciated!
Upvotes: 3
Views: 866
Reputation: 12900
To do this you need to use:
myLocationManager.startMonitoringSignificantLocationChanges()
From the docs:
Unfortunately from extensive testing the significant changes when they start to come through are very inaccurate so you may wish to switch on normal location updates at the point you receive a significant location change in the background.
myLocationManager.startUpdatingLocation()
Upvotes: 0