hermitdemschoenenleben / capacitor-plugin-android-post-notifications-permission

3 stars 1 forks source link

The request to accept permission never shown #3

Open mickjol opened 1 year ago

mickjol commented 1 year ago

I install the plugin, but when I request the permission nothing shown and the permission status never change.

let permissionStatus = await AndroidPostNotificationsPermission.checkPermissions();

if (permissionStatus.postNotifications === 'prompt') {
      permissionStatus = await AndroidPostNotificationsPermission.requestPermissions({
        permissions: ['postNotifications']
      });
}

The plugin return the same status { postNotifications: "prompt" }

MattijsE commented 1 year ago

Hi @mickjol I had the same issue as you. It turns out that you have to shown a prompt yourself to ask the user if they want to allow notifications. After they say yes, you should call . requestPermissions to see the real native prompt