requiresNotificationPermission method

Future<bool> requiresNotificationPermission()

Check if the app requires notification permission (Android 13+ or iOS).

Implementation

Future<bool> requiresNotificationPermission() async {
  if (Platform.isIOS ||
      (Platform.isAndroid && await _isAndroid13OrHigher())) {
    NotificationSettings settings =
        await _firebaseMessaging.getNotificationSettings();
    return settings.authorizationStatus == AuthorizationStatus.notDetermined;
  }
  return false;
}