info.plist中设置
始终 Privacy - Location Always Usage Description
使用期间 Privacy - Location When In Use Usage Description
设置为属性,解决弹框闪现
@property (strong, nonatomic) CLLocationManager* locationManager;
iOS8中定位的授权机制改变,需要进行手动授权。
self.locationManager = [[CLLocationManager alloc] init];
_locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters;
if ([[UIDevice currentDevice].systemVersion floatValue] >= 8) {
[_locationManager requestWhenInUseAuthorization];
}
[_locationManager startUpdatingLocation];
其他权限是否需要手动请求,才出现弹窗?
网友评论