Solve “Location request timed out” problem when using geolocation in React Native

Steve Mu
1 min readDec 24, 2017

--

It took me a few hours just to make the navigator.geolocation work. The trick is to {enableHighAccuracy: true} like so:

navigator.geolocation.getCurrentPosition((position) => {
console.log(position);

}, (err) => {
console.log(err);

}, { enableHighAccuracy: true, timeout: 2000, maximumAge: 3600000 })

beside following the instruction from the official documentation.

--

--