In Location Services, my app has three options: Never, While Using and Always. Is there any possibility of changing these options like removing the While Using option?
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];
}
}
}
This is the codes I use it to require authorization.
Aucun commentaire:
Enregistrer un commentaire