Open shilohchis opened 2 years ago
Set forceLocationManager: true
to use the default android location api
Still not working with forceLocationManager: true
Does getCurrentPosition
work or times out ? Also please provide a code sample.
getCurrentPosition
works
the sample code is like
const geolocationOptions = {
enableHighAccuracy: false, //try with true, not working
forceLocationManager: true, //try with false, not working
distanceFilter: 0,
interval: 100,
fastestInterval: 10,
showLocationDialog: true,
}
const locWatchIdRef = useRef<number | null>(null)
useEffect(() => {
startWatchingLocation()
return stopWatchingLocation
}, [])
const stopWatchingLocation = () => {
if (locWatchIdRef.current !== null) {
Geolocation.clearWatch(locWatchIdRef.current)
locWatchIdRef.current = null
}
}
const startWatchingLocation = () => {
locWatchIdRef.current = Geolocation.watchPosition(
(position) => {
// we do some calculation here
},
() => {
stopWatchingLocation()
},
geolocationOptions,
)
}
Try the example project and see if the same issue happens. Code looks fine to me.
Its not working here either with React 0.67.3 and a Motorola Moto G 9 Plus. All permissions granted, but the watcher callback is only called once.
With or without: forceLocationManager true/false or useSignificantChanges true/false
Its not working here either with React 0.67.3 and a Motorola Moto G 9 Plus. All permissions granted, but the watcher callback is only called once.
With or without: forceLocationManager true/false or useSignificantChanges true/false
I'm also facing same issue with watchPosition
Hi there, thanks for provide this awesome lib I have issue with![image](https://user-images.githubusercontent.com/11390982/142994190-af566422-ca48-406e-8e06-07150a34f5d5.png)
watchPosition
doesn't work when test on huawei cloud device It doesn't trigger thewatchPosition
, put the console log inside success & error callback not even call theconsole.log
The lib mentioned it use google play serviceFusedLocationProviderClient
API, is it not support for android without google play service??