iOS 11 定位权限弹窗不显示
2018-02-01 本文已影响318人
NieFeng1024
百度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;
}