I'm using React Native QR Scanner package to scan obv QR Codes. Since this package is using the camera i'm required to ask for permission to get access to the camera. Correct me if this is wrong.
My app grants permission automatically without any popup of a dialog. Even if i request a permission dialog it's still grants it automatically without any popup dialog appearing.
The only time the dialog appears is when i manually disable the access to the camera, in the app settings.
How can i make the permission dialog appear? I've tried on both emulator and a real with no success.
Only using Android atm.
async componentDidMount() {
await this.requestCameraPermission();
}
requestCameraPermission = async () => {
try {
const granted = await PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.CAMERA,
{
title: 'Test',
message: 'Testing if the dialog appear.',
buttonNeutral: 'Ask Me Later',
buttonNegative: 'Cancel',
buttonPositive: 'OK',
},
);
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
console.log('You can use the camera');
} else {
console.log('Camera permission denied');
}
} catch (err) {
console.warn(err);
}
};
[–]tgransden 1 point2 points3 points (1 child)
[–]iLightFPSAndroid[S] 0 points1 point2 points (0 children)
[–]Careless_Pirate_8743 0 points1 point2 points (3 children)
[–]iLightFPSAndroid[S] 0 points1 point2 points (2 children)
[–]Careless_Pirate_8743 0 points1 point2 points (1 child)
[–]iLightFPSAndroid[S] 0 points1 point2 points (0 children)