-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
getCurrentPosition Prompts the "Always Location" permission instead of the "On Use" permission #11822
Comments
Added a pull request for the simple change |
Closing this issue because it has been inactive for a while. If you think it should still be opened let us know why. |
IMO this should be reopened given the new iOS location permissions model. It seems we will be strongly encouraged to ask for "When in App" before "Always". In order for that to happen, this needs to be fixed. |
Hey @hramos - It looks like there are a few PRs submitted last month that would solve this, so I'll refrain from adding another. One of these pull requests seems to have been in "review-needed" for a while and the other looks like its waiting on a response. Anything I can do to help push these along? I figure the sooner we get one through the less back and forth there will be because of conflicts. Thanks for your help! |
Description
I have 2 scenarios in my app, the first one requires "Only in use" and the second requires "Always".
Most of my users are going to use only the first scenario (only in use).
I have an issue that when I call 'getCurrentPosition' (in RCTLocationOberver.m) from the first scenario flow (the one the requires only the "in use" permission) the "always in use" permission is being prompt by the iOS.
By looking at the code it's very simple to understand why it happens (method: beginLocationUpdatesWithDesiredAccuracy).
Is there any way to force it to prompt the right permission in this case? i'm afraid my users will not give consent to the permission because a fear of giving the app permissions for locations in the background.
I think this all started with this bug:
#1506
Reproduction
Add descriptions for both "always" and "in use" locations.
Call 'getCurrentPosition()' - obviously, you don't need the 'Always' permission for that. You will see that iOS prompt the "always in use" permission.
Solution
I think that reversing the IF statement in 'beginLocationUpdatesWithDesiredAccuracy' will fix this issue, I can't think about any scenario that will break due to this change.
#11823
Additional Information
The text was updated successfully, but these errors were encountered: