在位置服務中,我的應用程序有三個選項:從不,使用時和始終。是否有可能更改這些選項,如刪除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'。 –