Can anyone confirm if React Native Geolocation really works on Android? I am stuck with requesting time for placement when using the method getCurrentPosition()and without error message when using the method watchPosition().
I added the required permission (FINE LOCATION) to AndroidManifest.xml and the permission to post is allowed for the application.
Here is my implementation:
componentWillMount() {
navigator.geolocation.getCurrentPosition((position) => {
console.log('+++++++');
console.log(position.coords.longitude);
this.setState({
longitude: position.coords.longitude,
error: null,
});
},
(error) => {
console.log(error);
},
);
}
Real Version: 0.42
source
share