1

I am working on CLLocationManager. My App is register for Background "App registers for location updates". But When I am calling "stopUpdatingLocation" and went to background my app is not running more (My app become in Inactive state).

Why LocationManager behaves like that? Even my app is register for background location updates.

Hussain Shabbir
  • 14,801
  • 5
  • 40
  • 56
Bhumeshwer katre
  • 4,671
  • 2
  • 19
  • 29

2 Answers2

1

You have to Read and Check this link.

You have to Some changes in app.plist file like:

1) If your app use on location services to function properly, You have to add location-services to UIRequiredDeviceCapabilities.

2)if your app requires GPS service, you have to add GPS to UIRequiredDeviceCapabilities.

3) if you need to run your app longer then 10 minutes in the background, add location to UIBackgroundModes. Then your location manager will deliver locations beyond the 10-minute-limit.

4)you should also set NSLocationUsageDescription (can also be localized)

Dhaval Bhadania
  • 3,090
  • 1
  • 20
  • 35
  • My app is register for Background location update. I want my location at some point not all time. So I am calling "stopUpdatingLocation" when I don't want location updates. But Once I called "stopUpdatingLocation" after some time etc 20 sec my app stop executing single line of code also. – Bhumeshwer katre Oct 29 '13 at 06:09
0

Have you used locationManager:didFailWithError: method? The possible reasons were enumerated.

prakash
  • 73
  • 7