在位置服务中,我的应用程序有三个选项:从不,使用时和始终。是否有可能更改这些选项,如删除While Using
选项?更改位置服务中的选项
EDIT1:
- (void)checkAuth {
if ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0) {
if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined) {
[self.manager requestAlwaysAuthorization];
} else if ([CLLocationManager authorizationStatus] != kCLAuthorizationStatusAuthorizedAlways) {
[[[UIAlertView alloc] initWithTitle:@"title" message:@"message" delegate:self cancelButtonTitle:@"cancel" otherButtonTitles:@"Setting", nil] show];
}
} else {
if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined) {
[self.manager startUpdatingLocation];
[self.manager stopUpdatingLocation];
} else if ([CLLocationManager authorizationStatus] != kCLAuthorizationStatusAuthorized) {
[[[UIAlertView alloc] initWithTitle:@"title" message:@"message" delegate:self cancelButtonTitle:@"cancel" otherButtonTitles:@"Setting", nil] show];
}
}
}
这是我用它来要求授权的代码。
我检查过了,没有地方使用'requestWhenInUseAuthorization'。 –