NotificationEngine constructor
NotificationEngine({
- required FcmActionsConfig config,
- ActionRegistry? actionRegistry,
- ChannelRegistry? channelRegistry,
- MessagingGateway? messaging,
- LocalNotificationsGateway? localNotifications,
- FcmActionsEventBus? eventBus,
- ReplayGuard? replayGuard,
- 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,
);
}