title: Requesting Run time permission in android in react native
body: <p>I am trying to add runtime permission feature in my react native app but unable to add. Please help me. Here is my code. I have tried all the methods but it is not working.</p>
  
  <pre><code>samplefunction=()=&gt;{
  
    async function requestCameraPermission() {
      try {
        const granted = PermissionsAndroid.request(
          PermissionsAndroid.PERMISSIONS.CAMERA,
          {
            'title': 'Cool Photo App Camera Permission',
            'message': 'Cool Photo App needs access to your camera ' +
                       'so you can take awesome pictures.'
          }
  
        )
        if (granted === true || granted === PermissionsAndroid.RESULTS.GRANTED){
  
          console.log("You can use the camera")
  
          Alert.alert("You can use the camera")
  
        } else {
  
          console.log("Camera permission denied")
  
          Alert.alert("Camera permission denied")
  
        }
      } catch (err) {
        console.warn(err)
      }
    }
  
    requestCameraPermission(false);
  
  }
  </code></pre>