requestNotificationPermission

Request the notification runtime permission.

Android 13 (API 33) introduced a new runtime permission for notifications called POST_NOTIFICATIONS. Without this permission, apps on Android 13 cannot show notifications.

Note: This method does nothing on Android 12 and lower, or if your application does not target API 33 or higher.

Parameters

context

requesting the permission


Request the notification runtime permission.

Android 13 (API 33) introduced a new runtime permission for notifications called POST_NOTIFICATIONS. Without this permission, apps on Android 13 cannot show notifications.

Note: This method does nothing on Android 12 and lower, or if your application does not target API 33 or higher.

Parameters

context

requesting the permission

listener

Callback notifying whether the permission has been granted or not. Note that the permission will be considered as granted on Android 12 and lower. Listener will not be triggered if your application does not target API 33 or higher.