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

Geolocations say: Unable to retrieve location PERMISSION DENIED #750

Closed
iDVB opened this issue Apr 8, 2015 · 13 comments
Closed

Geolocations say: Unable to retrieve location PERMISSION DENIED #750

iDVB opened this issue Apr 8, 2015 · 13 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@iDVB
Copy link

iDVB commented Apr 8, 2015

react-native@0.3.1

navigator.geolocation does not seem to work. I've ensured I am selecting ALLOW in the simulator, and I've set the custom cords to be Lat: 55.02 Lng: -1.42 but still getting the error PERMISSION DENIED

It also appears that all my linkages are correct:
Linkages

@brentvatne
Copy link
Collaborator

https://facebook.github.io/react-native/docs/geolocation.html#content - "/!\ ATTENTION /!\ You need to add NSLocationWhenInUseUsageDescription key in Info.plist to enable geolocation, otherwise it's going to fail silently! !/ !/" - did you do this?

@frantic
Copy link
Contributor

frantic commented Apr 8, 2015

We should probably have the native module check whenever NSLocationWhenInUseUsageDescription is set and show warning / redbox. Anyone wants to send a quick PR? :)

@brentvatne
Copy link
Collaborator

@frantic - on it, PR coming!

@brentvatne
Copy link
Collaborator

@iDVB - confirmed that with custom location set and NSLocationWhenInUseUsageDescription configured, this works:

screen shot 2015-04-08 at 3 15 11 pm

@iDVB
Copy link
Author

iDVB commented Apr 9, 2015

Looks like that value is indeed set.
value

BTW, the code I'm using is from this tutorial.

Here is a video of it happening.

@brentvatne
Copy link
Collaborator

@iDVB - that happened to me and then I went into Debug > Location and chose Apple, pressed CMD+r to reload and it worked. Then switching to a custom location worked too, after that. Let me know if that helps!

@iDVB
Copy link
Author

iDVB commented Apr 9, 2015

WORKS! Kinda fiddly setup though. Not even sure what fixed it as I did, multiple refreshes, restarts of the Simulator and swapping the location from custom to Apple and back.
Thanks for the help.

@iDVB iDVB closed this as completed Apr 9, 2015
vjeux pushed a commit to vjeux/react-native that referenced this issue Apr 13, 2015
…f not

Summary:
As per facebook#750, throw error when trying to use the geolocation module and this key is not set. cc @frantic
Closes facebook#762
Github Author: Brent Vatne <brent.vatne@madriska.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
vjeux pushed a commit to vjeux/react-native that referenced this issue Apr 14, 2015
…f not

Summary:
As per facebook#750, throw error when trying to use the geolocation module and this key is not set. cc @frantic
Closes facebook#762
Github Author: Brent Vatne <brent.vatne@madriska.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
vjeux pushed a commit to vjeux/react-native that referenced this issue Apr 15, 2015
…f not

Summary:
As per facebook#750, throw error when trying to use the geolocation module and this key is not set. cc @frantic
Closes facebook#762
Github Author: Brent Vatne <brent.vatne@madriska.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
@coderdave
Copy link

I also keep getting "permission denied" even with NSLocationWhenInUseUsageDescription in the Info.plist. Using react-native 0.17.0

I have uninstalled the app in the simulator and selected "allow" when asked if it can access my location while I use the app.

The location is set to "Apple". I toggled that to different locations also.

rozele referenced this issue in microsoft/react-native-windows May 25, 2016
…f not

Summary:
As per #750, throw error when trying to use the geolocation module and this key is not set. cc @frantic
Closes facebook/react-native#762
Github Author: Brent Vatne <brent.vatne@madriska.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
@kyleskwon
Copy link

Restarting the simulator helped me fix this issue

@milon87
Copy link

milon87 commented Oct 23, 2017

navigator.geolocation.watchPosition through permission denied in Android OS>5

@QQizi
Copy link

QQizi commented Nov 17, 2017

Problem still occur for me.
NSLocationAlwaysUsageDescription & NSLocationWhenInUseUsageDescription are set

@QQizi
Copy link

QQizi commented Nov 17, 2017

The info.plist need NSLocationAlwaysAndWhenInUseUsageDescription & NSLocationAlwaysUsageDescription aswell

@91ranjan
Copy link

91ranjan commented Apr 5, 2018

Isn't this correct?

     <key>NSLocationAlwaysUsageDescription</key>
<string>Some description</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Some description</string>

@facebook facebook locked as resolved and limited conversation to collaborators May 29, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

9 participants