Open artstylee opened 2 years ago
@artstylee Did you find any fix for this?
@artstylee I've the same error with Android SDK 30+
Ran into this issue as well, my best guess is a default timeout was decreased somewhere.
Found the solution here: https://github.com/react-native-geolocation/react-native-geolocation/blob/master/example/GeolocationExample.js#L35
Setting the timeout to 20000 worked for me.
Geolocation.getCurrentPosition(
(info) => {},
(error) => {},
{ timeout: 20000 }
);
I had also faced this issue (Location Request Timed out) on different Android Devices. Now, I have used the Alternative Geolocation YARN (npm) package and its work for me. Please have a look. https://github.com/Agontuk/react-native-geolocation-service#why-
Thanks. Regards. :-)
Any progress/plans on fixing the issue?
GeolocationOptions
Adding timeout: 20000
(but default has to be 10 minutes) as proposed by @cwilby or using enableHighAccuracy: true
as in example seems to fix the issue, but what is the correct fix?
Also according to types definition GeolocationOptions
is optional, so default options should work fine.
GPS provider will always get the last cached location even set {maximumAge: 0, enableHighAccuracy: true}.
Here are repro steps. 1.Create two button for getting Location from Gps and Network. 2.Click Network Provider Button,then get the network location. 3.Click Gps Provider Button,then this would return the network location, I think it used Network Provider. 4.Close network, Repeat 3 step, it would use Gps get a new location.
I think LocationManager will be downgraded to use network even set Gps,But I dont want this downgrade.
without deps
{timeout: 1000, maximumAge: 0, enableHighAccuracy: true});
it works good and it gives me pretty accurate coords, but the are cached(i see tampstamps) i want to see up-to-date position or see an error. no cached values needed but if i set the options object it will fail with that