Agontuk / react-native-geolocation-service

React native geolocation service for iOS and android
https://www.npmjs.com/package/react-native-geolocation-service
MIT License
1.61k stars 292 forks source link

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

Open emzet93 opened 3 years ago

emzet93 commented 3 years ago

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

Agontuk commented 3 years ago

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.

joepake commented 3 years ago

{ 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.

SantiagoCor commented 1 year ago

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