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

No exception thrown when user denied. #20

Closed
lasseschmitt opened this issue Feb 12, 2018 · 1 comment
Closed

No exception thrown when user denied. #20

lasseschmitt opened this issue Feb 12, 2018 · 1 comment

Comments

@lasseschmitt
Copy link

Hey,

when the user does not accept the location permission (iOS) then there is no way to figure this out. I would accept that

var currentLocation = <String, double>{};

var location = new Location();

// Platform messages may fail, so we use a try/catch PlatformException.
try {
  currentLocation = await location.getLocation;
} on PlatformException {
  currentLocation = null;
}

throws an exception

@Lyokone
Copy link
Owner

Lyokone commented Mar 16, 2019

Hey ! Sorry for the late response, you should be able to manage this with requestPermission and hasPermission. Moreover, on getLocation, the plugin will try to request permission for you.
Good day !

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

No branches or pull requests

2 participants