-
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
iOS: Geolocation with NSLocationAlwaysUsageDescription #4886
Comments
Hey seb0zz, thanks for reporting this issue! React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.
|
@seb0zz I think if you've accepted Location permissions once it won't ask you again unless you clear the settings. It might be easier to just setup a new app and test I've used this in the past and it worked fine so you shouldn't have any problems. |
@christopherdro That was my first thought, too. So I tested my app on a real iOS device. I am now able to reproduce the problem by the following steps:
|
@seb0zz - you can add both and If you want to fix this, it should be a very easy PR :) https://github.com/facebook/react-native/blob/master/Libraries/Geolocation/RCTLocationObserver.m#L328-L333 - just update this block to check for either of them. I will merge right away! 🚀 |
On iOS the plist key NSLocationAlwaysUsageDescription was ignored and the location could not be retreived when using this key. Now both keys NSLocationWhenInUseUsageDescription and NSLocationAlwaysUsageDescription are supported. If NSLocationAlwaysUsageDescription is set, NSLocationWhenInUseUsageDescription will be simply ignored according to https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW18
On iOS the plist key NSLocationAlwaysUsageDescription was ignored and the location could not be retreived when using this key. Now both keys NSLocationWhenInUseUsageDescription and NSLocationAlwaysUsageDescription are supported. If NSLocationAlwaysUsageDescription is set, NSLocationWhenInUseUsageDescription will be simply ignored according to https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW18
Summary: brentvatne this is the pull request you requested See issue #4886 On iOS the plist key NSLocationAlwaysUsageDescription was ignored and the location could not be retreived when using this key. Now both keys NSLocationWhenInUseUsageDescription and NSLocationAlwaysUsageDescription are supported. If NSLocationAlwaysUsageDescription is set, NSLocationWhenInUseUsageDescription will be simply ignored according to https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW18 I read the contribution guidelines regarding the Objective-C coding standards. Hopefully my line length breaks are okay - otherwise just give me a shout and I will fix that. Didn't write any line of Objective-C before so^^ Closes #5093 Reviewed By: svcscm Differential Revision: D2823206 Pulled By: nicklockwood fb-gh-sync-id: dd856a18416796749025e4b32d9c72895401916d
Summary: brentvatne this is the pull request you requested See issue facebook#4886 On iOS the plist key NSLocationAlwaysUsageDescription was ignored and the location could not be retreived when using this key. Now both keys NSLocationWhenInUseUsageDescription and NSLocationAlwaysUsageDescription are supported. If NSLocationAlwaysUsageDescription is set, NSLocationWhenInUseUsageDescription will be simply ignored according to https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW18 I read the contribution guidelines regarding the Objective-C coding standards. Hopefully my line length breaks are okay - otherwise just give me a shout and I will fix that. Didn't write any line of Objective-C before so^^ Closes facebook#5093 Reviewed By: svcscm Differential Revision: D2823206 Pulled By: nicklockwood fb-gh-sync-id: dd856a18416796749025e4b32d9c72895401916d
I use version 0.17.0 of React Native
Geolocation works for me if I use
NSLocationWhenInUseUsageDescription
like mentioned in the documentation on https://facebook.github.io/react-native/docs/geolocation.html. Unfortunately it doesn't ask for the permissions if I specifyNSLocationAlwaysUsageDescription
in myInfo.plist
. Is this a known issue?Could also be related to #4879
The text was updated successfully, but these errors were encountered: