1

I have enabled background mode for location services in my app, but when I send the app to the background, it seems that the location services are switched off after a few seconds (the arrow of location services in the device's status bar disappears). I'm not programmatically stopping the location manager, and I'm using standard location service with its best accuracy.

What can I be missing?

Thanks in advance

AppsDev
  • 12,319
  • 23
  • 93
  • 186

1 Answers1

0

For iOS 7 and above, When the app is on the background and not executing code. Normally, the system will move app from background mode to suspended mode automatically without any notification. When you app is in suspended mode, you can not do anything (no location update).

In order to keep the app active in the background for iOS 7 and above, you will have to know when to restart the locationManager.

I have a blog post with a detail explanation and also a complete solution uploaded to Github on how to keep the app active in the background, please check this post for more details:- Background Location Services not working in iOS 7

Community
  • 1
  • 1
Ricky
  • 10,485
  • 6
  • 36
  • 49
  • hanks, is that a problem only for iOS 7? I'm now testing with an iOS 6 device and an iOS 7.1 device. The iOS6 is still running location services in background for more than 20 min. However, iOS 7.1 has stopped after 15 min more or less. Could this be because the system is killing the app? – AppsDev Jun 20 '14 at 07:43
  • Yes, The solution that used to work on iOS 6 can not work for iOS 7 any longer. I developed another location based app before iOS 7 is released. The previous solution works really well in iOS 6. After iOS 7 has been released and many of the app users upgraded to iOS 7 and all the location service suddenly not working in the background and they were complaining about it. That's how I developed that solution for iOS 7 at the First place. – Ricky Jun 20 '14 at 07:53