iOS 11 定位权限弹窗不显示

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 定位权限弹窗不显示)