checkPermissionList method

  1. @override
Future<List<NotificationPermission>> checkPermissionList({
  1. String? channelKey,
  2. List<NotificationPermission> permissions = const [NotificationPermission.Badge, NotificationPermission.Alert, NotificationPermission.Sound, NotificationPermission.Vibration, NotificationPermission.Light],
})
override

Checks which notification permissions have been granted to the app.

The optional channelKey parameter is a String that represents the key of the notification channel for which to check permissions. If this parameter is omitted, permissions will be checked for all channels.

The optional permissions parameter is a list of NotificationPermission values to check. This parameter is optional and defaults to a list of permissions that are commonly requested by apps, including NotificationPermission.Alert, NotificationPermission.Sound, NotificationPermission.Badge, NotificationPermission.Vibration, and NotificationPermission.Light.

This method returns a Future that resolves to a list of NotificationPermission values indicating which permissions have been granted to the app. If a permission has been granted, it will be included in the list. If a permission has not been granted, it will not be included in the list.

This method can be used to check which notification permissions have been granted by the user, so that the app can adjust its behavior accordingly.

Implementation

@override
Future<List<NotificationPermission>> checkPermissionList(
    {String? channelKey,
    List<NotificationPermission> permissions = const [
      NotificationPermission.Badge,
      NotificationPermission.Alert,
      NotificationPermission.Sound,
      NotificationPermission.Vibration,
      NotificationPermission.Light
    ]}) async {
  return permissions;
}