Skip to content

[@nativescript/localNotifications] - Android LocalNotifications.hasPermission() returns false after accepting notifications with firebase messaging #643

@joaomsg11

Description

@joaomsg11

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions