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

GPS off - CoarseLocation - Location settings are not satisfied

Open fcataldi opened this issue 4 years ago • 7 comments
trafficstars

Hi all The getCurrentPosition method, just works if I turn on the GPS. I wanna get positition without precision. I'm trying do it, using this configuration:

showLocationDialog: false, accuracy: { android: "low", ios: "threeKilometers" }, enableHighAccuracy: false, timeout: 3000, maximumAge: 10000, forceRequestLocation: true

There are something wrong?

fcataldi avatar Mar 11 '21 20:03 fcataldi

forceRequestLocation ony kicks in when user selects No from location dialog. You're not showing the location dialog, that's why it's bailing out early with that error.

Agontuk avatar Mar 12 '21 12:03 Agontuk

Tks for your quick reply. I tried without forceRequestLocation and got the same error. I tried in three Android devices. Any other idea?

fcataldi avatar Mar 12 '21 16:03 fcataldi

I'm really thankful for your support. If be possible, could you give me a testable example of use?

fcataldi avatar Mar 12 '21 16:03 fcataldi

Setting showLocationDialog: true should fix the issue.

Agontuk avatar Mar 13 '21 10:03 Agontuk

Dont works and I dont wanna force user to active the GPS, because I dont need great precision. There are several others accuracy setting for IOS and Android, but don't work. I tried everything I thought

fcataldi avatar Mar 13 '21 19:03 fcataldi

showLocationDialog is needed not only for enabling gps, but also to enable location service if it's disabled. So you need to set this to true. You can set this to false if running in background service.

Also, if you're using ACCESS_COARSE_LOCATION and low accuracy, it'll not show dialog to ask user to enable gps.

Agontuk avatar Mar 14 '21 14:03 Agontuk

Hi @Agontuk, In my case i did ACCESS_COARSE_LOCATION (in AndroidManifest.xml) and low accuracy on android but even after this its showing dialog.

siddharth-kt avatar Mar 18 '22 17:03 siddharth-kt