title: React-native:- Location permission dialog is not working
body: <p>I want to enable location of my device(android pie). I have read the documentation of Permissions of react-native and then tried to implement it but every time it says "Location permission denied". I even tried to use external library(react-native-permissions) then it says:- "undetermined: User has not yet been prompted with a permission dialog". I have given the permissions(FINE_LOCATION and COARSE_LOCATION) in manifest also. I even tried to give permission manually in app permissions but still it says permission denied. How can i enable location.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>async requestLocationPermission() {
  try {
    const granted = await PermissionsAndroid.request(
      PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
      {
        title: "Example App",
        message: "Example App access to your location "
      }
    );
    if (granted === PermissionsAndroid.RESULTS.GRANTED) {
      console.log("You can use the location");
      alert("You can use the location");
    } else {
      console.log("location permission denied");
      alert("Location permission denied");
    }
  } catch (err) {
    console.warn(err);
  }
  }
  </code></pre>
  
  <p>calling it in componentDidMount:</p>
  
  <pre><code>componentDidMount(){
  this.requestLocationPermission();
  }
  </code></pre>