-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Android 12+ notification permissions not requested and showing as blocked #2004
Comments
@alexp25 I'm having the same issue here with my app not being able to request permissions initially. Did you end up getting this to work? Or how did you end up allowing a new user to grant permissions to push within your app? |
I also was unable to get Update 07/26/23: I realized that branch alexp25 suggested (i.e. fquirin/cordova-plugin-local-notifications) also contains some of the fixes from cordova-plugin-local-notification-12. It also appears to work on my end. |
I ended up using another plugin (https://github.com/NeoLSN/cordova-plugin-android-permissions) for requesting notification permissions on Android 12+ and the fork for the actual notifications. Haven't tried the suggested alternative yet. |
I did something similar to @alexp25 - used the fix from https://github.com/fquirin/cordova-plugin-local-notifications and the android permissions plugin from https://github.com/NeoLSN/cordova-plugin-android-permissions to request notification permissions. This works! ...unfortunately, Android 14 (API 34) breaks it again because it now blocks permissions for SCHEDULE_EXACT_ALARM by default. I tried enabling it using the android permissions plugin but it doesn't seem to work. |
@xallysie when using https://github.com/NeoLSN/cordova-plugin-android-permissions what permissions are you asking for? |
It seems all notifications are needed:
This works, though on clicking the notification the app restarts |
@orhan-swe I think you need to set this flag to prevent restart: |
I just received the following warning in Play Console when I submitted a new update: |
@orhan-swe Sorry it took me a while to respond. All of the functions in your list are included in my AndroidManifest, and only two are not enabled by default (POST_NOTIFICATIONS and SCHEDULE_EXACT_ALARMS). Here is the code I use to request the POST_NOTIFICATIONS permission, which works for android 14:
And this is the code I use to request the SCHEDULE_EXACT_ALARM permission, which does nothing:
Not exactly sure why. Both use the plugin created NeoLSN. |
quick update for anyone following this issue: I made a small plugin that addresses the SCHEDULE_EXACT_ALARM permissions issue for Android 14+. https://github.com/xallysie/cordova-plugin-android14-schedule-exact-alarm |
The
requestPermission
function does not seem to do anything on Android 12+. When I check the native permissions, notifications show as blocked. As this repo is outdated and doesn't even work on Android 12+, I'm using a fork (https://github.com/fquirin/cordova-plugin-local-notifications) which works fine, except for requesting notification permissions popup.Your Environment
cordova -v
): 10.0.0 (cordova-lib@10.1.0)cordova platform ls
): android 11.0.0Expected Behavior
The
requestPermission
function should trigger the native popup to allow notifications.Actual Behavior
The
requestPermission
function does not seem to do anything.Steps to Reproduce
Reproduce this issue; include code to reproduce, if relevant
Context
What were you trying to do?
Debug logs
Include iOS / Android logs
The text was updated successfully, but these errors were encountered: