I have a problem with application. I'm new in iOS and objective c. I worked on background location app. Everything is good until auto lock happens or user presses power button. Then app is running for about 5 to 8-9 minutes and after that it stops updating location manager. Is this normal? This happens on iPhone with 6.0.1 iOS version. I can't test it on another phone because member center is down for the time being. I presume that app goes to suspended state. When i open it again it starts updating location manager instantly.
Any solution?
Asked
Active
Viewed 1,280 times
0

Jovan
- 1,741
- 4
- 19
- 38
2 Answers
3
CLLocationManager has a property pausesLocationUpdatesAutomaticaly that is by default YES. That means that if a user is in background and not moving for some time then system battery saver removes location update for the app. If you put this to NO system will never closed location update if you don't terminate app or closed it yourself.

Jovan
- 1,741
- 4
- 19
- 38
1
Follow this tutorial about getting the location in bacvkground:
Background Modes in iOS Tutorial
Around the middle you have a section called "Location in background", it explains everything you need to do in order to get locations in background.

Antonio MG
- 20,382
- 3
- 43
- 62
-
All of this is implemented. Maybe my logic is wrong. I start location update in a singleton model class, because i don't want logic to be inside a view. – Jovan Jul 23 '13 at 13:54
-
When phone is up all is good...problem is when it goes to sleep by a power button or auto lock. – Jovan Jul 23 '13 at 13:56
-
My code is like that. Maybe the problem is with iPhone5. I have an ipod too (also on 6.0.1 iOS) and on ipod everything is working good. – Jovan Jul 23 '13 at 14:22