iOS 11 定位权限弹窗不显示

2018-02-01  本文已影响318人  NieFeng1024

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

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

    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;
}

上一篇 下一篇

猜你喜欢

热点阅读