flutter-permission-handler icon indicating copy to clipboard operation
flutter-permission-handler copied to clipboard

.Request() won't show dialog after an initial denial of a permission

Open djimonn opened this issue 6 years ago • 4 comments

🐛 Bug Report

After denying a certain permission (in my case: camera), .request() doesn't show a dialog and hence won't let me allow the camera usage again. Btw the status of the permission is Denied, not PermanentlyDenied.

Expected behavior

Permission dialog shows up again.

Reproduction steps

Simple app to request camera permission.

Configuration

Version: 5.0.1+1

Platform:

  • [x] :iphone: iOS
  • [ ] :robot: Android

djimonn avatar Oct 19 '20 14:10 djimonn

So, turns out, this is not a bug but the expected result on iOS (as per this SO answer).

djimonn avatar Oct 26 '20 10:10 djimonn

post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) target.build_configurations.each do |config| config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [ '$(inherited)', ## dart: PermissionGroup.camera 'PERMISSION_CAMERA=1' ] end end end

Add this in pod file and delete pod lock and pod install then it will work

akhiljohny avatar Jul 07 '22 08:07 akhiljohny

Thanks @akhiljohny you saved my day.

FaizanAhmad127 avatar Feb 07 '23 20:02 FaizanAhmad127

Same case for android API 33. When permission dialog for external_storage/READ_MEDIA was set to "Deny" for second time the permission status came as denied instead of permanentlydenied. Any guess?

mohsiniscoding avatar Jul 02 '23 23:07 mohsiniscoding