I\'m trying to use some fancy iBeacons without success, kCLAuthorizationStatusNotDetermined all time. According to other questions it\'s a requirement to add those keys to
I have noticed that if your instance of CLLocationManager is destroyed before the alert shows, you will never see the alert. In my case I was creating a local variable of the location manager in the AppDelegate to ask for permission.
CLLocationManager *locationManager = [[CLLocationManager alloc] init];
if ([locationManager respondsToSelector:@selector(requestAlwaysAuthorization)]) {
[locationManager requestAlwaysAuthorization];
}
Changing the local variable to an instance variable made the alert to display:
@interface AppDelegate () {
CLLocationManager *_locationManager;
}
@end
_locationManager = [[CLLocationManager alloc] init];
if ([_locationManager respondsToSelector:@selector(requestAlwaysAuthorization)]) {
[_locationManager requestAlwaysAuthorization];
}