Android - Turn on Location Service popup not coming
See original GitHub issueHi,
My setup is
"dependencies": {
"@react-native-community/geolocation": "^1.4.2",
"react": "16.8.6",
"react-native": "0.60.4",
"react-native-geolocation-service": "^3.0.0",
"react-native-gesture-handler": "^1.3.0",
"react-navigation": "^3.11.1"
},
And code is:
Geolocation.getCurrentPosition(
(position) => {
console.warn("Position " + position.coords.latitude + " " + position.coords.longitude);
},
(error) => {
// See error code charts below.
console.warn("Error " + error.code, error.message);
},
{ enableHighAccuracy: true, timeout: 15000, maximumAge: 10000, }
);
Scenario:
- I have already added code for PermissionsAndroid and after getting the permission I am hitting the above mentioned code.
- Android -
When the Location in top drawer menu is ON then I am getting location.
But when Location is off, it is not showing the following popup to ask user to enable the location service:
Instead, it directly goes to (error) and says, “error.code = 2, No location provider available.”
I think in earlier versions of library this used to work. But facing this problem in 3.0.0. 3. In iOS it is working fine. It is showing popup to ask for Permission for Location.
Any help on this would be appreciated.
P.S. @Agontuk Thanks for this library. We really appreciate your efforts.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:35 (10 by maintainers)
Top Results From Across the Web
Choose which apps use your Android phone's location
Find which apps use your phone's location · Swipe down from the top of the screen. · Touch and hold Location . ·...
Read more >"Allow all the time" location prompt not coming in Android SDK ...
On Android 10+ Android first pops up the permission for location with three options. The user has to pick 'While using this app'....
Read more >How to popup turn on device location dialog box - MSDN
I am using Visual Studio 2019 Xamarin Forms. How can I open the dialog box "to continue turn on device location which uses...
Read more >'Google Location Service is disabled' alert keeps popping up
It sounds like your entire Location Service is turned off, not just GPS. Is that typical for you? It's possible for Location Service...
Read more >Why am I getting an error asking me to enable location services?
If you haven't allowed your browser to access location services, then you will need to change the permissions: On Android devices: Within your...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed in
3.1.0
Guys, let me know if this flow makes sense. Looping in @cladjules since he implemented the
forceRequestLocation
feature.showLocationDialog
isfalse
, it’ll invoke error callback with codeSETTINGS_NOT_SATISFIED
.showLocationDialog
istrue
, it’ll show location popup to improve location accuracy.OK
, it’ll update the location settings and invoke success callback with location.NO THANKS
andforceRequestLocation
isfalse
, it’ll invoke error callback with codeSETTINGS_NOT_SATISFIED
.NO THANKS
andforceRequestLocation
istrue
but location provider is not enabled, it’ll invoke error callback with codePOSITION_UNAVAILABLE
.NO THANKS
andforceRequestLocation
istrue
and location provider is enabled, it’ll invoke success callback with location if it’s possible.