-
-
Notifications
You must be signed in to change notification settings - Fork 691
Error after approving on iOS: PlatformException(PERMISSION_DENIED, Access to location data denied, null) #252
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
@FlashJonas recently we have completely refactored the |
@mvanbeusekom I confirm that the problem still exist in 5.0.0 I decided to follow the packages docs and added to my plist file the 3 keys :
First call to
prompt the user for permission (with 3 choices) : If I press "only while using the app" the terminal log the following :
Second press is ok and position is logged without problem :
|
Still have the same issue on my iPhone 5s, 12.2, using geolocator 5.1.2.
Logs from running the above code: |
I face the same error:
|
I got the same error when used all three permission strings. If I only use NSLocationWhenInUseUsageDescription the app is working again. My best guess is that when using all three permissions, the app is started and asking for location before user is asked to confirm it. The ui behavior seems to confirm it, but it's just a guess. Anyway, if you can live with just NSLocationWhenInUseUsageDescription, then remove the other two. |
same issue :( on the last version stable channel of flutter. |
this package sucks... Same error, latetst version of flutter on android 10. |
I have the same issue! |
I wonder if this issue is going to be addressed, I see it's more than a year old and people still face it. Recently I started learning Flutter and came across with the same issue, with exactly the same steps to reproduce. When I select "Only while using the app" option from iOS prompt I get an exception in the flutter console even tho the second time I request for the location from the app I get the correct location data. P.S. using the latest |
I am currently working on a fix for this and a list of other issues (see #430, for more details). It will be a major update though. Currently iOS side is ready and will work on the Android side now. |
This should be fixed in version 6.0.0 |
It might be late to reply but I was also facing the same problem where the app was not asking for permission in iOS and was working perfectly fine in android. Because it was not asked for permission that's why the permission code was not working for iOS. I found a package named "location_permissions" which can be used to ask for permission manually. Steps to do are following
That's it now you should get a popup in the iOS app which will ask for the permission of location. |
🐛 Bug Report
Code asks for position, user approves, code throws an error:
PlatformException(PERMISSION_DENIED, Access to location data denied, null)
But after requesting the position a second time, the correct position is instantly returned without dialog or errors.
Expected behavior
Position is returned and no errors are thrown when asking for position and user approving.
Reproduction steps
Configuration
Flutter version: "Channel dev, v1.5.8"
Geolocator Version: ^4.0.2
Platform:
The text was updated successfully, but these errors were encountered: