Martin
Martin

Reputation: 12203

locationManager:didFailWithError: not called if user Location Services are off

From the documentation for locationManager:didFailWithError:

If the user denies your application’s use of the location service, this method reports a kCLErrorDenied error. Upon receiving such an error, you should stop the location service.

It works when the user press "Don't Allow" to the question "MyApp Would Like to Use Your Current Location", so you can manage this eventuality.

But nothing happen when the user press "Cancel" to the question "Turn On Location Services to Allow "MyApp" to Determine Your Location" (message which comes if Location Services are turned OFF.

Is there a way to have any kind of callback?

Upvotes: 3

Views: 1083

Answers (1)

Fran Sevillano
Fran Sevillano

Reputation: 8163

Use [CLLocationManager locationServicesEnabled] for that particular case.

Upvotes: 6

Related Questions