flutter-permission-handler
flutter-permission-handler copied to clipboard
Permission Handler Notfication not working
I want to show the dialog asking the user to allow the notification. The package is working fine for the camera, microphone, etc but it's not working for notification.
I also had this problem with the ^10.0.0 version! But I tried using an older version :6.0.1 to fix this problem.
I want to show the dialog asking the user to allow the notification. The package is working fine for the camera, microphone, etc but it's not working for notification.
in ^10.0.0 their documents mention this - Some permissions will not show a dialog asking the user to allow or deny the requested permission. This is because the OS setting(s) of the app are being retrieved for the corresponding permission. The status of the setting will determine whether the permission is granted or denied.
The following permissions will show no dialog:
Notification Bluetooth The following permissions will show no dialog, but will open the corresponding setting intent for the user to change the permission status:
manageExternalStorage systemAlertWindow requestInstallPackages accessNotificationPolicy
I also had this problem with the ^10.0.0 version! But I tried using an older version :6.0.1 to fix this problem.
I tried it with the older version but it still does not work for me.
I want to show the dialog asking the user to allow the notification. The package is working fine for the camera, microphone, etc but it's not working for notification.
in ^10.0.0 their documents mention this - Some permissions will not show a dialog asking the user to allow or deny the requested permission. This is because the OS setting(s) of the app are being retrieved for the corresponding permission. The status of the setting will determine whether the permission is granted or denied.
The following permissions will show no dialog:
Notification Bluetooth The following permissions will show no dialog, but will open the corresponding setting intent for the user to change the permission status:
manageExternalStorage systemAlertWindow requestInstallPackages accessNotificationPolicy
Is there any way to show a dialog asking for permission to allow notification using a permission handler?
I want to show the dialog asking the user to allow the notification. The package is working fine for the camera, microphone, etc but it's not working for notification.
in ^10.0.0 their documents mention this - Some permissions will not show a dialog asking the user to allow or deny the requested permission. This is because the OS setting(s) of the app are being retrieved for the corresponding permission. The status of the setting will determine whether the permission is granted or denied. The following permissions will show no dialog: Notification Bluetooth The following permissions will show no dialog, but will open the corresponding setting intent for the user to change the permission status: manageExternalStorage systemAlertWindow requestInstallPackages accessNotificationPolicy
Is there any way to show a dialog asking for permission to allow notification using a permission handler?
even contact permissions have stopped showing a dialog for me !
I want to show the dialog asking the user to allow the notification. The package is working fine for the camera, microphone, etc but it's not working for notification.
in ^10.0.0 their documents mention this - Some permissions will not show a dialog asking the user to allow or deny the requested permission. This is because the OS setting(s) of the app are being retrieved for the corresponding permission. The status of the setting will determine whether the permission is granted or denied. The following permissions will show no dialog: Notification Bluetooth The following permissions will show no dialog, but will open the corresponding setting intent for the user to change the permission status: manageExternalStorage systemAlertWindow requestInstallPackages accessNotificationPolicy
Is there any way to show a dialog asking for permission to allow notification using a permission handler?
include PERMISSION_NOTIFICATIONS =1 into your iOS/podfile
I tried it with the older version but it still does not work for me.
^10.0.0 版本也有这个问题!但我尝试使用旧版本 :6.0.1 来解决这个问题。
我用旧版本尝试过,但它仍然不适合我。
try to add <key>NSMicrophoneUsageDescription</key> <string>访问麦克风</string>
to path:ios->Runner->Info.plist
This might help https://www.youtube.com/watch?v=uMvGpBOT0ZY
Dear @Sania-Developer,
Can you inform us about the platform where you are experiencing this issue? Furthermore, please add this output of flutter doctor -v
to this issue. It helps a lot during investigation of this issue.
I also experience the issue on android. Here's my device info
- Android version: 13
- Device: Oppo
- Model: CPH2333
flutter doctor -v
:
[✓] Flutter (Channel stable, 3.10.5, on Mac OS X 10.15.7 19H2026 darwin-x64, locale en-KH)
• Flutter version 3.10.5 on channel stable at /Users/apple/Documents/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 796c8ef792 (3 months ago), 2023-06-13 15:51:02 -0700
• Engine revision 45f6e00911
• Dart version 3.0.5
• DevTools version 2.23.1
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
• Android SDK at /Users/apple/Library/Android/sdk
• Platform android-33, build-tools 33.0.1
• ANDROID_HOME = /Users/apple/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
• All Android licenses accepted.
[!] Xcode - develop for iOS and macOS (Xcode 12.4)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 12D4e
✗ Flutter requires Xcode 13 or higher.
Download the latest version or update via the Mac App Store.
! CocoaPods 1.10.1 out of date (1.11.0 is recommended).
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
[✓] VS Code (version 1.81.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (3 available)
• CPH2333 (mobile) • 2cd77615 • android-arm64 • Android 13 (API 33)
• macOS (desktop) • macos • darwin-x64 • Mac OS X 10.15.7 19H2026 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 116.0.5845.110
[✓] Network resources
• All expected network resources are available.
- Package version: 10.4.3
@chounry,
Can you try to test it with the example app. It forks on my testing device Android 13.
Kind regards,
@TimHoogstrate
Yes. I tried it and it works. So it seems that I did something wrong, but I couldn't find it.
I already put <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
in the app/src/main/AndroidManifest.xml
When calling await Permission.notification.request()
, the result always return denied immediately without the popup dialog. By the way, the isPermanentlyDenied
is false. When I try await Permission.locationWhenInUse.request()
it shows the popup.
Could it be because of conflict between packages?
I have fixed it. I increase the targetSdkVersion
in app/build.gradle
to 33.
Closing the issue as it was resolved per comment above.