Push Notification Permissions

In Android 13 (API 33) and higher, runtime notification permissions are required for push notifications. If you don't request notification permission at runtime, you can use the requestPushNotificationAuthorization() method from Netmera to request permission from the user.

Step 1: Requesting Notification Permission

To request notification permission, call the requestPushNotificationAuthorization() method. Ensure that your project targets API 33 or higher before using this method. Here’s how you can request notification permissions:

// Request push notification permission
Netmera.requestPushNotificationAuthorization();

Step 2: Checking Notification Permission Status

If you need to check whether the user has granted or denied notification permissions, you can use the areNotificationsEnabled() method. This returns a boolean indicating whether notifications are enabled.

 Netmera.areNotificationsEnabled().then((enabled) {
      // Use the enabled status of permission as boolean
 });

Last updated

Was this helpful?