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 … #7539

Closed
wants to merge 1 commit into from

Conversation

sriks
Copy link
Contributor

@sriks sriks commented Dec 3, 2015

JIRA https://jira.appcelerator.org/browse/TIMOB-20002
This addresses the issue of invoking location permissions not in main thread.

@@ -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(), ^{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use TiThreadPerformOnMainThread(^{
[[self locationPermissionManager] requestWhenInUseAuthorization];
}, NO); instead. As it does a couple of checks regarding the main thread to prevent crashes.

@AngelkPetkov AngelkPetkov reopened this Dec 3, 2015
@AngelkPetkov
Copy link
Contributor

Closing the PR sorry ,because it doesn't fully fix the issue, the callback will still print Success even if we disallow access.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants