3

I am using GPS in iphone and it show conformation message for use location service. and i want to trap what user select "Allow" or "No". can any one suggest how i do this?

Thank

Ortwin Gentz
  • 52,648
  • 24
  • 135
  • 213
Mitesh Khatri
  • 3,935
  • 4
  • 44
  • 67

1 Answers1

8

You don't get a direct callback from this alert. However, if the user does not allow Core Location usage, you'll receive a -locationManager:didFailWithError: with a kCLErrorDenied error to your CLLocationManagerDelegate.

Since iOS 4.2, you can also listen to -locationManager:didChangeAuthorizationStatus: or check the authorizationStatus of CLLocationManager. This gives you a detailed status.

Ortwin Gentz
  • 52,648
  • 24
  • 135
  • 213