cordova-plugin-android-permissions icon indicating copy to clipboard operation
cordova-plugin-android-permissions copied to clipboard

POST_NOTIFICATIONS don't work for Android 10

Open FranGhe opened this issue 1 year ago • 1 comments

I have a Cordova Project and two devices... one with Android10 and the other with Android13. All devices have notification permissions but with Android10 it always return false.

var permissions = cordova.plugins.permissions;
permissions.checkPermission(permissions.POST_NOTIFICATIONS, function( status ){
    if ( status.hasPermission ) {
      console.log("Yes :D ");
    }
    else {
      console.warn("No :( ");
    }
});

Is there a way to fix it?

FranGhe avatar Feb 21 '24 12:02 FranGhe

That permission doesn't exist for devices before Android 13, thus when you request it, you get a negative response, as that permission doesn't exist in the system.

You do not ask for that permission on Android 12L and older, you just assume you have the right for notifications automatically.

faugusztin avatar Apr 13 '24 09:04 faugusztin