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.

Geolocation can not watch the position.

See original GitHub issue

Geolocation can not watch the position. It only updates when you go to homescreen and reopen the app. To recreate this problem, just use the example on React Native docs: http://facebook.github.io/react-native/releases/0.31/docs/geolocation.html#watchposition

componentDidMount(){
  this.watchID = navigator.geolocation.watchPosition((position) => {
      var lastPosition = JSON.stringify(position);
      this.setState({lastPosition});
    });
}

Using React Native version 0.31.0 & 0.30.0 on iOS.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:19 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
ericvicenticommented, Jan 6, 2017

Closing for now. Please re-open if this problem is still here!

1reaction
gitsadcommented, May 9, 2018

I have the same problem which @briangainer has. @ericvicenti I think this issue should be opened.

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 ...
Read more >
navigator.geolocation.watchPosition just not working
watchPosition() method is used to register a handler function that will be called automatically each time the position of the device changes.
Read more >
Geolocation Watch Position throwing error - Ionic Forum
I've got the $cordovaGeolocation plugin installed and injected into my controller. I know the plugin is working because it is successfully ...
Read more >
Turn Location Services and GPS on or off on your iPhone ...
Go to Settings > Privacy > Location Services. Make sure that Location Services is on. Scroll down to find the app. Tap the...
Read more >
What you need to know while using the Geolocation API
Watching user location ... Sometimes accessing geolocation data once may not be sufficient, especially when the user is on the move. You will...
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