subscribe static method

Future<void> subscribe({
  1. String? notificationIcon,
  2. Color? backgroundIcon,
})

Implementation

static Future<void> subscribe(
    {String? notificationIcon, Color? backgroundIcon}) async {
  FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);

  await _requestPermission();

  final fcmToken = await _firebaseMessaging.getToken();
  await InngageService.registerSubscriber(fcmToken);

  await receiveNotificationForeground(backgroundIcon);
  await receiveNotificationClosed();

  await _config(notificationIcon);
}