0

I was reading the following two forum posts about getting a user's location every X minutes:

Getting user location every n minutes after app goes to background

How do I get a background location update every n minutes in my iOS application?

But then I realized this only works if the app is in background mode. (And the point of it being so the OS doesn't ever suspend or terminate it for inactivity, to take back some system resources, but correct me if I'm wrong).

But is there a way to wake up a terminated app every X minutes to get a GPS location?

I know you can subscribe to significant location changes, but those are only if the user moves more than 500m... and has no concept of time (every X minutes).

Community
  • 1
  • 1
Gukki5
  • 497
  • 6
  • 22
  • you can use pushnotifications to wake your app up after X minutes. and the GPS chip queues the locations traversed all the while. So it bombards it to the app as if the app was actually recording the whole track. – rd_ Jun 19 '16 at 17:56
  • @rd_ so you're saying that when a push notification is received and the OS calls the following method: `- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))handler` that in that method, I can call the standard location services? Initiate a CLLocationManager and get the GPS coords? And then pass it to my server over the network? – Gukki5 Jun 20 '16 at 18:19
  • @rd_ OR.. that if I have `[locationManager startUpdatingLocation]` running and location authorized as a Background Task, that the GPS chip will continue to gather locations for my app, even while its terminated, and then pass all these locations to me once it becomes live again?.. Wouldn't this happen then once the user resumed the app again at some future time? – Gukki5 Jun 20 '16 at 18:23
  • if you see the comments of my answer over here http://stackoverflow.com/questions/37907218/notify-backend-whenever-user-enters-exits-a-region/37910379#37910379 it might answer all your questions – rd_ Jun 22 '16 at 08:20

0 Answers0