nonTerminatedNotificationStream method
Streams notifications received while the app is in the background or foreground.
Returns the path to redirect to if the user clicked on a background notification, and shows a dialog if the user clicked on a foreground notification to ask if the user wants to navigate to the page.
Implementation
Stream<String?> nonTerminatedNotificationStream() {
return StreamGroup.merge([
FirebaseMessaging.onMessageOpenedApp.asyncMap(_getRedirectUri),
FirebaseMessaging.onMessage.asyncMap(_foregroundNotificationHandler),
]);
}