[@nativescript/localNotifications] - Android LocalNotifications.hasPermission() returns false after accepting notifications with firebase messaging
Info
"@nativescript/local-notifications": "^6.4.0", "@nativescript/android": "8.9.1", "@nativescript/firebase-messaging": "5.0.2",
Problem
Both LocalNotifications.hasPermission() and LocalNotifications.requestPermissions() return false in a application with already given permissions for push notifications. This does not allow for usage of the LocalNotifications.schedule with error
This piece of code
const authStatus = await firebase() .messaging() .requestPermission(<any>{});
console.log('Android - checking notification permissions ...', authStatus);
const aceptedLocalNotifications = await LocalNotifications.hasPermission();
console.log('Android - LocalNotifications.requestPermission', aceptedLocalNotifications);
returns
Android - checking notification permissions ... 0
Android - LocalNotifications.requestPermission false
Error
Error in LocalNotifications.requestPermission: Error: Permission not granted
I believe this happens to me as well, after requesting permission using @nativescript-community/perms