No message is being prompted. It just denies the permission. I have also made same, the targetedSdk version and compilesdk version.
I've made same, the targetedSdk version and compilesdk version.
My function on 'Request' Button:
try {
const granted = await 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 === PermissionsAndroid.RESULTS.GRANTED) {
alert("You can use the camera")
} else if (PermissionsAndroid.RESULTS.DENIED){
console.log("Camera permission denied")
}
} catch (err) {
console.warn(err)
}
I expect a prompt message and by tapping 'Yes', it must grant the permission but no prompt is shown.