navigator.geolocation.getCurrentPosition(
(position) => console.log(position),
(error) =>console.log(error),
{ enableHighAccuracy: true, timeout: 20000, maximumAge: 10000 });
and I have add already but still not working
navigator.geolocation.getCurrentPosition(
(position) => console.log(position),
(error) =>console.log(error),
{ enableHighAccuracy: true, timeout: 20000, maximumAge: 10000 });
and I have add already but still not working
I have been getting the same error on physical device (android). I noticed GPS was disabled then. After turning the GPS on, I did not get this error anymore and got the current position in callback. Hope it helps.
In case, you want to prompt the user to enable the GPS if it is not, there is a good answer on stackoverflow : react-native check and promp user to enable Network/GPS