I'm using flutter to create an app for both iOS and android. I need photos
and storage
permission for iOS and android to access photos to update user profile pictures.
I used the permission_handler
package to request permissions. And this works well in android but not in iOS.
<key>NSPhotoLibraryUsageDescription</key>
<string>We need Photos access to allow you to update Profile Picture.</string>
var permission = Platform.isAndroid
? Permission.storage
: Permission.photos;
var permissionStatus = await permission.request();
print("isGranted: " +
permissionStatus.isGranted.toString() +
" isDenied: " +
permissionStatus.isDenied.toString() +
" isLimited: " +
permissionStatus.isLimited.toString() +
" isRestricted: " +
permissionStatus.isRestricted.toString() +
" isPermanentlyDenied: " +
permissionStatus.isPermanentlyDenied.toString());
flutter: isGranted: false isDenied: false isLimited: false isRestricted: false isPermanentlyDenied: true
I tried to uninstall and reinstall the app on the simulator (iPhone 12pro max) but still not able to request permission (show request popup).
The behavior on iOS for the Permissions package has changed to default all permissions to denied. You have to update the PList and turn on the permissions you wish to use within your application for it to work.