watchPosition doesn't raise an error if the user disables location services
See original GitHub issueWhen a user opens the app with location services enabled, and the app then registers a watchPosition
callback, and then the user disables location services, and goes back to the app, watchPosition
never raises an exception. React Native core’s navigator.geolocation has this same issue, but I would expect watchPosition
to raise an exception the same way that getCurrentPosition
would. This would be useful for detecting that location services are off so the app could prompt a user to reenable it.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Is there a way to check if geolocation has been DECLINED ...
Hello from 2018! Firefox 61 throws the proper error code when the user denies permission now, regardless of the method (never vs. not...
Read more >What you need to know while using the Geolocation API
Learn how to effectively use the Geolocation API with this article filled with tips, tricks, and necessities when requesting user location.
Read more >Android - Turn on Location Service popup not coming #108
If user clicks NO THANKS and forceRequestLocation is true but location provider is not enabled, it'll invoke error callback with code POSITION_UNAVAILABLE ....
Read more >Geolocation.watchPosition() - Web APIs | MDN
The Geolocation method watchPosition() method is used to register a handler function that will be called automatically each time the position ...
Read more >A Beginner's Guide To Using Geo IP API - apilayer Blog
On the other hand, if something goes wrong when retrieving the location or the user denies it, then the errorCallback the function is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same issue. And in addition: If I run my application with disabled GPS, then i click “No thanks” on request to turn GPS on (after that errorCallback is triggering), and then I manually turn GPS on - nothing happens after that (I expect that successCallback should be triggered).
It should be fixed in v5.0.0. Sorry for not being able to fix this sooner.