1

In iOS7, will an app that has requested continuous location updates (not signification changes/ region monitoring) be relaunched after a reboot?

When I reboot my phone, the app is suspended, then terminated. When I restart my phone, the app stays in the terminated state until I manually start it.

I've tried adding a background fetch with minimum refresh intervals to relaunch the app, but that's never called either.

In the apple doc it explains that if I enable significant location changes, it will launch my app from a terminated state, but does not mention anything about continuous location updates.

Any recommendations on how to get my app to continue receiving updates after relaunch?

slidmac07
  • 387
  • 1
  • 2
  • 14

2 Answers2

1

I don't think this is going to be possible because its no use if your app launches in the background anyway because the monitoring for location updates initial request HAS to be made while your app is in the foreground.

If this request is made while the app is in the background then it doesn't work. You somehow have to get your app into the foreground so you can start the process of getting updates again.

You could add significant location changes temporarily as an experiment so that your app gets woken up and then see if you can get location updates once your app has been launched into a background state but I'm 99% sure you won't be successful.

Gruntcakes
  • 37,738
  • 44
  • 184
  • 378
1

I have tested for many months, the only possible way for iOS to relaunch the app for new location updates after the app is terminated/suspended is using the locationManager method startMonitoringSignificantLocationChanges. If you use startUpdatingLocation, iOS will not relaunch the app for you and hence the app can not get the location update.

If you want to understand the details about the differences between getting location update in the background vs getting location update even when the app is kill/terminated/suspended, please see:-

A) Getting location update when the app is In the background, please see: Background Location Services not working in iOS 7

B) Getting location update when the app is suspended/terminated, please see: How to Get Location Updates for iOS 7 and 8 Even when the App is Suspended

I have written 2 very long article explaining the different between the 2 scenario. The source codes for the above 2 scenario are also available on the GitHub.

Community
  • 1
  • 1
Ricky
  • 10,485
  • 6
  • 36
  • 49