美文网首页
iOS 11 定位权限弹窗不显示

iOS 11 定位权限弹窗不显示

作者: NieFeng1024 | 来源:发表于2018-02-01 19:41 被阅读318次

iOS 11 定位权限弹窗不显示-官方链接

百度SDK 升级之后,定位权限弹窗不显示,原因是苹果要求调用请求。

  • requestAlwaysAuthorization
  • requestWhenInUseAuthorization
    CLLocationManager *_locationManagerSystem;

if (![self getUserLocationAuth]) {
        _locationManagerSystem = [[CLLocationManager alloc]init];
        [_locationManagerSystem requestWhenInUseAuthorization];
    }

- (BOOL)getUserLocationAuth {
    BOOL result = NO;
    switch ([CLLocationManager authorizationStatus]) {
        case kCLAuthorizationStatusNotDetermined:
            break;
        case kCLAuthorizationStatusRestricted:
            break;
        case kCLAuthorizationStatusDenied:            
            break;
        case kCLAuthorizationStatusAuthorizedAlways:
            result = YES;
            break;
        case kCLAuthorizationStatusAuthorizedWhenInUse:
            result = YES;
            break;
            
        default:
            break;
    }
    return result;
}

相关文章

网友评论

      本文标题:iOS 11 定位权限弹窗不显示

      本文链接:https://www.haomeiwen.com/subject/fgljzxtx.html