位置管理器请求始终授权权限警报



当用户打开应用程序时,我正在使用[locationManager requestAlwaysAuthorization],然后出现权限警报"即使您不使用该应用程序,也允许单击以访问您的位置"

以及如果我正在使用

[locationManager requestWhenInUseAuthorization];

我想得到用户的答案(允许或不允许)有一个事件指示用户选择?

询问后,可以调用 authorizationStatus,这里举个例子:

    switch ([CLLocationManager authorizationStatus]) {
    case kCLAuthorizationStatusAuthorizedAlways:
        NSLog(@"User said yes");
        break;
    default:
        break;
}

最新更新