Right after the app launches, I am getting permission to use Camera from the user. But before opening camera if I check if the user has granted camera permission or not, I get the response as "false" even when it is allowed.
Here is my code:
PermissionsAndroid.check('camera').then(response => {
if (response === true){
//Open scanner
}
else if (response === false){
Alert("Please enable camera permission in device settings.")
}
})
Please try as following:
PermissionsAndroid.check(PermissionsAndroid.PERMISSIONS.CAMERA).then(response => { ..
and not
PermissionsAndroid.check('camera').then(response => { ..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With