react-native-android-location-enabler icon indicating copy to clipboard operation
react-native-android-location-enabler copied to clipboard

Check if location is enabled without opening modal

Open ArekChr opened this issue 5 years ago • 8 comments

It will be nice to have a function that only checks if the location is turned on instead of asking to turn it on.

Useful in case for localize icons such as Google Maps. if GPS is off, localize the show question mark icon.

ArekChr avatar Sep 19 '19 20:09 ArekChr

You can use this package for that: https://github.com/react-native-community/react-native-permissions

Permissions.check('location' ).then(response => {
  // response is: 'authorized', 'denied', 'restricted', or 'undetermined'
});

https://github.com/react-native-community/react-native-permissions#permissions-statuses

gianpaj avatar Sep 22 '19 10:09 gianpaj

Ok, why not. I'll add the function as soon as possible.

Richou avatar Sep 22 '19 20:09 Richou

@gianpaj from what I understand it is not a good solution. As the user can give location permission but the gps can still be turned off..we need to check if the gps is on..is there a method to do that?

nes123 avatar Oct 04 '19 10:10 nes123

Hi. @Richou Is there any update for this issue?

anees17861 avatar Mar 04 '21 08:03 anees17861

Hi, any update for this issue?

Darkilen avatar Jun 30 '22 14:06 Darkilen