getNotificationSettings static method

Future<NotificationSettings?> getNotificationSettings()

Tries to retrieve the notificationSettings by invoking FirebaseMessaging.

Implementation

static Future<NotificationSettings?> getNotificationSettings() async {
  if (!PlatformUtils.pushNotifications) {
    // If push notifications aren't considered supported on this device, then
    // there's no need to even try.
    return null;
  }

  try {
    return await FirebaseMessaging.instance.getNotificationSettings();
  } catch (e) {
    Log.debug(
      'Unable to `getNotificationSettings()` due to: $e',
      'LogController',
    );
  }

  return null;
}