question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

watchPosition doesn't raise an error if the user disables location services

See original GitHub issue

When 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:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
avasurocommented, Mar 28, 2019

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).

0reactions
Agontukcommented, May 30, 2020

It should be fixed in v5.0.0. Sorry for not being able to fix this sooner.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found