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

[Bug]: Notification permission status always returns Denied but was granted in request

Open quanvm97 opened this issue 4 months ago • 5 comments

Please check the following before submitting a new issue.

Please select affected platform(s)

  • [ ] Android
  • [x] iOS
  • [ ] Windows

Steps to reproduce

The issue only happened on iOS devices.

  1. The permission request dialog is shown, and the permission is allowed. (Verified on iOS device that the permission is granted.) Image

  2. Calling Permission.notification.status or Permission.notification.request() both return Denied. The result is shown in the screenshot below.

Image

Expected results

Must be "Granted" status if the permission was allowed.

Actual results

Always returns Denied.

Code sample

Code sample
final permissionStatus = await Permission.notification.request();
// or use
final permissionStatus = await Permission.notification.status;

print("=============== $permissionStatus");

Screenshots or video

Screenshots or video demonstration

[Upload media here]

Version

12.0.0+1 (also tried 12.0.1)

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.29.2, on macOS 15.6.1 24G90 darwin-arm64
    (Rosetta), locale en-VN)
[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.3)
[✓] VS Code (version 1.102.1)
[✓] Connected device (5 available)
    ! Error: Browsing on the local area network for Nauqhnim’s iPhone. Ensure
      the device is unlocked and attached with a cable or associated with the
      same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code
      -27)
[✓] Network resources

• No issues found!

quanvm97 avatar Sep 26 '25 03:09 quanvm97

I'm also facing this issue.

htetaunglin avatar Sep 29 '25 06:09 htetaunglin

I'm also facing this issue too

burakJs avatar Sep 30 '25 11:09 burakJs

I am also facing this issue.

mohsinelahii avatar Oct 02 '25 07:10 mohsinelahii

This issue can also occur if you don’t add the notification permission flag in your Podfile. It might be worth checking if you have the following configuration inside the post_install block:

config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
  '$(inherited)',

  ## dart: PermissionGroup.notification
  'PERMISSION_NOTIFICATIONS=1',
]

Without this, the iOS permission status will always return Denied.

mateusztylman avatar Oct 02 '25 12:10 mateusztylman

config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [ '$(inherited)',

dart: PermissionGroup.notification

'PERMISSION_NOTIFICATIONS=1', ]

Thank you, it worked.

mohsinelahii avatar Oct 06 '25 12:10 mohsinelahii