flutter-permission-handler
flutter-permission-handler copied to clipboard
[Question]: iOS `photosAddOnly` and `photo` always return `permanentlyDenied`, without dialog or app settings entry
Please check the following before submitting a new issue.
- [X] I have searched the existing issues.
- [X] I have carefully read the documentation.
Please select for which platform(s) you need help
- [ ] Android
- [X] iOS
- [ ] Windows
Your question
Asking for the mentioned permissions always returns that they are permanently denied on iOS. There is no dialog asking for permission, nor there is anything mentioning them in app settings. The app was freshly installed on iOS simulator or in real device in Testflight.
I am not sure, what I am missing:
Podfile
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
# You can remove unused permissions here
# for more information: https://github.com/BaseflowIT/flutter-permission-handler/blob/master/permission_handler/ios/Classes/PermissionHandlerEnums.h
# e.g. when you don't need camera permission, just add 'PERMISSION_CAMERA=0'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
'$(inherited)',
## dart: PermissionGroup.camera
'PERMISSION_CAMERA=1',
## dart: PermissionGroup.photosAddOnly
'PERMISSION_PHOTOS_ADD_ONLY=1',
## dart: PermissionGroup.notifications
'PERMISSION_NOTIFICATIONS=1',
]
end
end
end
Info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>FirebaseAppDelegateProxyEnabled</key>
<false />
<key>FLTEnableImpeller</key>
<false />
<key>NSPhotoLibraryAddUsageDescription</key>
<string>photo</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>photo</string>
<key>CFBundleDisplayName</key>
...
Asking for permission like this:
await Permission.photosAddOnly.request()
Version
11.3.1