In my iOS app, geolocation works fine and displays my location as an observer.
However, for Android, the code never runs when it succeeds or fails with a callback when I put it in warning or console logs.
watchID: (null: ?number),
this.watchID = navigator.geolocation.watchPosition(
(position) => {
this.setState({
userLocation: position,
geo: true
}, this.fetchBusinesses());
},
(error) => console.log(error.message),
{enableHighAccuracy: true, timeout: 2000, maximumAge: 1000}
);
source
share