I don’t get a prompt for permissions when I run the function:
I use iOS and have this line in my info.plist
<key>NSCameraUsageDescription</key> <string>To capture profile photo please grant camera access</string>
getPermissionStatus() async {
await Permission.camera.request();
var status = await Permission.camera.status;
print(status);
if (status.isGranted) {
log('Camera Permission: GRANTED');
setState(() {
isCameraPermissionGranted = true;
});
// Set and initialize the new camera
onNewCameraSelected(cameras[0]);
refreshAlreadyCapturedImages();
} else if (status.isPermanentlyDenied) {
// The user opted to never again see the permission request dialog for this
// app. The only way to change the permission's status now is to let the
// user manually enable it in the system settings.
openAppSettings();
} else {
log('Camera Permission: DENIED');
}
}
The Log is allways…PermissionStatus.denied
2
Answers
For iOS, you need to configure following things for getting permission dialog in iOS:
you can find more permission group of iOS in permission_handler documentation (scroll to Setup section of ios): permission_handler