Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-20002]: iOS: Ti.Geolocation.requestLocationPermissions is not … #7540

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions iphone/Classes/GeolocationModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,9 @@ -(void)requestLocationPermissions:(id)args
(currentPermissionLevel == kCLAuthorizationStatusAuthorized)) {
errorMessage = @"Cannot change already granted permission from AUTHORIZATION_ALWAYS to AUTHORIZATION_WHEN_IN_USE";
} else if (!userDidApproveOrReject) {
[[self locationPermissionManager] requestWhenInUseAuthorization];
dispatch_async(dispatch_get_main_queue(), ^{
[[self locationPermissionManager] requestWhenInUseAuthorization];
});
}
} else {
errorMessage = @"The NSLocationWhenInUseUsageDescription key must be defined in your tiapp.xml in order to request this permission";
Expand All @@ -881,7 +883,9 @@ -(void)requestLocationPermissions:(id)args
if (currentPermissionLevel == kCLAuthorizationStatusAuthorizedWhenInUse) {
errorMessage = @"Cannot change already granted permission from AUTHORIZATION_WHEN_IN_USE to AUTHORIZATION_ALWAYS";
} else if(!userDidApproveOrReject) {
[[self locationPermissionManager] requestAlwaysAuthorization];
dispatch_async(dispatch_get_main_queue(), ^{
[[self locationPermissionManager] requestAlwaysAuthorization];
});
}
} else {
errorMessage = @"The NSLocationAlwaysUsageDescription key must be defined in your tiapp.xml in order to request this permission.";
Expand Down