Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6290

React-native-geolocation with maximumAge: 0, is still getting cached location

$
0
0

Yo guys,I'm using Geolocation from 'react-native-geolocation-service' library and the details are as follows. The problem I am facing is that android & iOS is returning the cached position. I have maximumAge set to 0, so it should never get any cached location and always get new location.Is there a way, an other approach, that I can always get the current location from the GPS in react native using this library? Any help is appreciated. Thanks.

NOTE:It's very hard to reproduce. This doesn't happen that often, but still occurs very few times.

export function getLocation(onSuccess: (position: GeoPosition) => void, onError?: (error: GeoError) => void) { Geolocation.getCurrentPosition(onSuccess, onError, { accuracy: { ios: 'hundredMeters' }, distanceFilter: 0, enableHighAccuracy: isAndroid, showLocationDialog: false, forceRequestLocation: true, }); }

This happens when asking for lokation in app


Viewing all articles
Browse latest Browse all 6290

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>