react-native-geolocation-service icon indicating copy to clipboard operation
react-native-geolocation-service copied to clipboard

[android] watchPosition success callback should be called after enabling device location

Open emzet93 opened this issue 3 years ago • 3 comments

Currently when watchPosition is enabled and user turns off location settings onError callback is called immediately. But if user turns on location again onSuccess callback is never called. Is there any way to achieve such behavior?

For now the only working solution I found is to set distanceFilter option to 0

emzet93 avatar Mar 09 '21 11:03 emzet93

Did you mean it's not being invoked immediately ? If distanceFilter is not zero, then it'll wait until user moves a certain distance and trigger success callback.

Agontuk avatar Mar 25 '21 16:03 Agontuk

{ enableHighAccuracy: true, maximumAge: 0, distanceFilter: 10 }); I encountered this issue. User moves far enough but callback is not called. I must run the app again to its work.

joepake avatar Apr 09 '21 07:04 joepake

I'm also having this issue. If someone finds a solution besides turning distanceFilter to 0, please share it. It shouldn't wait till a location update happens for calling onSuccess callback. I have an app with tools that depend on the user location. If the onError callback is called, this tools are disabled. I depend on onSuccess callback to turn them back on

SantiagoCor avatar Aug 03 '23 19:08 SantiagoCor