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

No working POST_NOTIFICATIONS #493

Closed
SinGlEBW opened this issue Mar 1, 2023 · 3 comments
Closed

No working POST_NOTIFICATIONS #493

SinGlEBW opened this issue Mar 1, 2023 · 3 comments

Comments

@SinGlEBW
Copy link

SinGlEBW commented Mar 1, 2023

cordova -v: 11.0.0
"android-minSdkVersion" value="22"
"android-targetSdkVersion" value="31"
"android-compileSdkVersion" value="31"

    Does not output Permission
    diagnostic.requestRuntimePermission((status) => { console.log(status) }, () => {}, diagnostic.permission.POST_NOTIFICATIONS)
@dpa99c
Copy link
Owner

dpa99c commented Mar 1, 2023

If you don't implement the error callback, you won't know if the reason that the success callback is not being called is because the error callback is: () => {}
Check you have added the permission to your manifest, build and run the example project to validate your development environment

@mirko77
Copy link

mirko77 commented Jun 14, 2023

POST_NOTIFICATIONS always returns DENIED_ALWAYS when targeting API 33 in Android 11, even when the notification permission is granted. (which is the default, on Android 12 and below it doesn't prompt for permission because you can always receive push notifications.)

Works in Android 13 API 33, no problems. It triggers the prompt on first install, then the status is correct.

@dpa99c
Copy link
Owner

dpa99c commented Sep 29, 2023

I can reproduce the same outcome: building with API 33 on device running Android 11, the permission result from Android is DENIED for POST_NOTIFICATIONS.
You'd think the correct response from Android would be GRANTED since it's implicitly granted since Android 11 doesn't implement POST_NOTIFICATIONS as a run-time permission.
I'll update the plugin code to handle this correctly.

@dpa99c dpa99c closed this as completed in ec97085 Sep 29, 2023
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

3 participants