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 291 forks source link

GPS off - CoarseLocation - Location settings are not satisfied #253

Open fcataldi opened 3 years ago

fcataldi commented 3 years ago

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?

Agontuk commented 3 years ago

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.

fcataldi commented 3 years ago

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

fcataldi commented 3 years ago

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

Agontuk commented 3 years ago

Setting showLocationDialog: true should fix the issue.

fcataldi commented 3 years ago

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

Agontuk commented 3 years ago

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.

siddharth-kt commented 2 years ago

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.