notificationRedirect function
Implementation
@Riverpod(keepAlive: true)
Stream<String?> notificationRedirect(NotificationRedirectRef ref) {
return StreamGroup.merge([
// Terminated notifications from Firebase Cloud Messaging
Stream.fromFuture(
ref.read(cloudMessagingServiceProvider).terminatedNotificationHandler(),
),
// Background and foreground notifications from Firebase Cloud Messaging
ref.read(cloudMessagingServiceProvider).nonTerminatedNotificationStream(),
// Terminated notifications from local notifications
Stream.fromFuture(
terminatedNotificationHandler(),
),
// Background and foreground notifications from local notifications
backgroundNotificationStream.stream.asBroadcastStream(),
]);
}