NotificationEngine constructor

NotificationEngine({
  1. required FcmActionsConfig config,
  2. ActionRegistry? actionRegistry,
  3. ChannelRegistry? channelRegistry,
  4. MessagingGateway? messaging,
  5. LocalNotificationsGateway? localNotifications,
  6. FcmActionsEventBus? eventBus,
  7. ReplayGuard? replayGuard,
  8. ActionQueue? actionQueue,
})

Implementation

NotificationEngine({
  required this.config,
  ActionRegistry? actionRegistry,
  ChannelRegistry? channelRegistry,
  MessagingGateway? messaging,
  LocalNotificationsGateway? localNotifications,
  FcmActionsEventBus? eventBus,
  ReplayGuard? replayGuard,
  ActionQueue? actionQueue,
}) : actions = actionRegistry ?? ActionRegistry(),
     channels = channelRegistry ?? ChannelRegistry(),
     messaging = messaging ?? FirebaseMessagingGateway(),
     localNotifications =
         localNotifications ?? FlutterLocalNotificationsGateway(),
     events = eventBus ?? FcmActionsEventBus(),
     _replayGuard =
         replayGuard ?? ReplayGuard(window: config.replayProtectionWindow),
     _actionQueue =
         actionQueue ?? ActionQueue(maxRetries: config.maxActionRetries),
     navigator = NotificationNavigator(
       navigatorKey: config.navigatorKey,
       routes: config.routes,
     ) {
  actions.registerAll(config.actions);
  channels.registerAll(config.channels);
  parser = NotificationParser(
    maxPayloadBytes: config.maxPayloadBytes,
    defaultChannelId: config.defaultChannelId,
    resolveAction: actions.find,
  );
}