Disabling 'Location Services' in Android's system settings, and then calling navigator.geolocation.getCurrentPosition will result in an error, 'No available location provider.', instead of an object, where that's the value of message.
In LocationModule.java, change this line:
error.invoke("No available location provider.");
to this, to match the phrasing of the same error from startObserving
emitError(PositionError.PERMISSION_DENIED, "No location provider available.");
pull request welcome!
I created pull request #11723.
Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!
If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:
If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.
I am using react-native version 0.47.1 and this issue is still there, has not been fixed. Think this might need to be reopened.
i am using rn v0.48 and this issue is still there.How to fix it ???
I'm getting the same issue. error handler is never getting called. the app is hanging.
I'm using "react-native": "0.44.0", & this is still occurring.
same here "react-native": "0.45.1"
I worked around this using the following: I used a timeout function which runs a fallback location query if X seconds passes. I ensure that this only happens if Platform.OS === 'android'
same here "react-native": "0.53.0"
+1 with react-native: 0.55.4
+1 "react-native": "0.54.4",
you folks do know this is open source and you can open a PR to fix this, right? :)
I am using react-native: 0.53.3 and the issue still exists. Any workaround?
fix landed in 0.56.0 version (https://github.com/facebook/react-native/commit/226bff3ed0772ff3b9d69ea45fb57f3c0c930029), please check.
Most helpful comment
you folks do know this is open source and you can open a PR to fix this, right? :)