1

I want to track the user location at full time. I don't need a precise accuracy, 100 m should be enough. On android for exemple a set an interval of 5 min to check the new location (but on ios as far as i know their is no such "interval" concept)

So i start to monitor location update like this :

LocationManager.DesiredAccuracy = kCLLocationAccuracyHundredMeters
LocationManager.DistanceFilter = 25
LocationManager.AllowsBackgroundLocationUpdates = true;
FLocationManager.startUpdatingLocation;

now the problem, i would like also to economize the battery when the user is not significantly moving. So i set PausesLocationUpdatesAutomatically = true and i can see in the log that after 5 or 6 location updates i receive the event locationManagerDidPauseLocationUpdates. That great because no need to continuously wake up my app if no significant location update are detected

Now the problem, the doc say that it's our responsibility to restart location services again. But when the app is in background how to do this ?

zeus
  • 12,173
  • 9
  • 63
  • 184
  • You cannot; See the *note* in the documentation - https://developer.apple.com/documentation/corelocation/cllocationmanager/1620553-pauseslocationupdatesautomatical You may want to use significant location change monitoring (if available) or 3km accuracy. – Paulw11 Jul 17 '17 at 09:53
  • @Paulw11 reading your link, it says "After a pause occurs, it is your responsibility to restart location services again when you determine that they are needed." So I wonder how you can restart it. I've already tried to run `startUpdateLocations` for both when I have `requestAlwaysAuthorization` or `requestInUseAuthorization` but they **don't** work. The `desiredAccuracy` doesn't matter. It doesn't work! It seems that you have 2 options start significant Location Tracking or create a region >> let that launch the app and catch it's key like [here](https://stackoverflow.com/a/27742678/5175709) – mfaani Jul 20 '17 at 17:27
  • Yes, as I said; if you allow location updates to pause in the background you cannot resume location updates until the user returns your app to the foreground. – Paulw11 Jul 20 '17 at 19:38
  • i saw the location update paused (catch the event) and resume by himself (catch also the event) all of this when the app was in background! – zeus Jul 20 '17 at 20:28

0 Answers0