cordova-plugin-android-permissions
cordova-plugin-android-permissions copied to clipboard
POST_NOTIFICATIONS don't work for Android 10
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?
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.