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

Fix permissions request #2

Closed
wants to merge 1 commit into from
Closed

Fix permissions request #2

wants to merge 1 commit into from

Conversation

ndegheselle
Copy link

@ndegheselle ndegheselle commented Mar 6, 2023

Replaced CheckStatus by Request,
Not working on iOS because of : jamesmontemagno/GeolocatorPlugin#322

Seems like the issue jamesmontemagno/GeolocatorPlugin#322 have been ported there :I
@ndegheselle ndegheselle closed this Mar 7, 2023
@datvm
Copy link

datvm commented Mar 8, 2023

Hi any idea when the Nuget package will be updated? I am having this issue as well when trying to roll out my own Permission check due to #1 .

@gktval
Copy link
Owner

gktval commented Mar 8, 2023

Hi any idea when the Nuget package will be updated? I am having this issue as well when trying to roll out my own Permission check due to #1 .

You should set permission requests in your own app prior to calling CrossGeolocator. That way you can provide any customization to the request.

Or by calling OnRequestPermissionResult in your main activity:

public override void OnRequestPermissionsResult(int requestCode, string[] permissions, Android.Content.PM.Permission[] grantResults)
{
    Plugin.Permissions.PermissionsImplementation.Current.OnRequestPermissionsResult(requestCode, permissions, grantResults);
	base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
}

@datvm
Copy link

datvm commented Mar 10, 2023

Hi this is not Android problem. I already rolled out the Permission implementation on Android. It's for iOS. Basically on iOS, I have my own CLLocationManager with DidChangeAuthorization event handler so I can check/request for permission. However when calling GetPositionAsync() for example, the code also has its own Permission check which caused the exception.

IMO, you are right that the plugin should not have to worry about Permission at all and let user worry about it (I currently have a problem where the plugin wouldn't work if user gives only Approximate location permission on Android as well).

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.

3 participants