Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 29603

How to appear GPS Icon in react-native?

$
0
0

My client wants to appear GPS Icon on the status bar when I open app or screen that's contain Map, So I add function that asks user to allow Location permission and it's work very well and I can get Lat/Long but GPS "Location" Icon not appear so how can I force app to appear this icon?

GPS

here's my Ask for permission function

 async requestLocationPermission() {
    try {
      const granted = await PermissionsAndroid.request(
        PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
        {
          title: 'App Location Permission',
          message: 'App needs access to your Location ',
          buttonNeutral: 'Ask Me Later',
          buttonNegative: 'Cancel',
          buttonPositive: 'OK',
        },
      );
      if (granted === PermissionsAndroid.RESULTS.GRANTED) {
        this.getLocation();
      } else {
        this.setState({next: false});
      }
    } catch (err) {
      console.log('err ', err);
    }
  }

Viewing all articles
Browse latest Browse all 29603

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>