Watch position not working on huawei cloud device
Hi there, thanks for provide this awesome lib
I have issue with watchPosition doesn't work when test on huawei cloud device
It doesn't trigger the watchPosition, put the console log inside success & error callback not even call the console.log
The lib mentioned it use google play service FusedLocationProviderClient API, is it not support for android without google play service??

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