Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: .request returns permanently denied, but status only denied #1393

Open
4 of 5 tasks
blingkonnerth opened this issue Oct 8, 2024 · 1 comment
Open
4 of 5 tasks

Comments

@blingkonnerth
Copy link

Please check the following before submitting a new issue.

Please select affected platform(s)

  • Android
  • iOS
  • Windows

Steps to reproduce

Add any kind of permission, e.g. Permission.notification and deny the native popup.

When checking the status, there are two way:

  1. await Permission.notification.status
  2. await Permission.notification.request()

Expected results

I expect to get the same status for both variants.

Actual results

But:

  1. status -> .denied
  2. request -> permanentlyDenied

The 2nd is what I actually need, because otherwise I don't know if the native request was done before.

I couldn't find anything about this, but it seems a quite important missing feature/bug, at least for me.

Code sample

Code sample
[Paste your code here]

Screenshots or video

Screenshots or video demonstration

[Upload media here]

Version

11.3.0

Flutter Doctor output

Doctor output
[Paste your output here]
@remonh87
Copy link

remonh87 commented Oct 8, 2024

I had the same issue but fixed it by adding the following code in to the 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 infomation: https://github.com/Baseflow/flutter-permission-handler/blob/main/permission_handler_apple/ios/Classes/PermissionHandlerEnums.h
      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
        '$(inherited)',
        ## dart: PermissionGroup.notification
        'PERMISSION_NOTIFICATIONS=1',
      ]
    end
  end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants