NeoLSN / cordova-plugin-android-permissions

This plugin is designed for supporting Android new permissions checking mechanism.
Apache License 2.0
273 stars 175 forks source link

POST_NOTIFICATIONS don't work for Android 10 #128

Open FranGhe opened 7 months ago

FranGhe commented 7 months ago

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?

faugusztin commented 5 months ago

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.