When doing CLLocationManager, is there a delegate method that gets called when a user clicked the "Allow" or "Don't allow" prompt that request to use Location?
I tried this but this doesn't get called after a user "Allow" or "Don't allow".
- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status;
Also, is there a variable that will tell me what the user selected?
I tried the below, but that always returns true.
locationManager.locationServicesEnabled
Thank you,
Tee
There is a delegate method for that
- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status {
if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorized) {
// user allowed
}
}
[CLLocationManager locationServicesEnabled]
only tells your if the location service are enabled on the device.
[CLLocationManager authorizationStatus]
returns the actual status you're looking for.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With