Question


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?

Était-ce utile?

La solution

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.

Autres conseils

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top