migrated Marianum Message module to the Marianum-Connect API and implemented push notification deep linking

This commit is contained in:
2026-07-11 17:37:50 +02:00
parent ff23199345
commit c444ed54a5
13 changed files with 237 additions and 78 deletions
+9
View File
@@ -93,6 +93,13 @@ class _AppState extends State<App> with WidgetsBindingObserver {
NotificationTasks.navigateToTalk(context, chatToken: token);
}
void _onNewsletterTapPending() {
final id = PushTapRouter.pendingNewsletterId.value;
if (id == null || !mounted) return;
PushTapRouter.pendingNewsletterId.value = null;
AppRoutes.openNewsletterById(context, id: id);
}
Future<void> _handlePendingWidgetNavigation() async {
final pending = await WidgetNavigation.consumePendingTimetableTap();
if (!pending || !mounted) return;
@@ -191,6 +198,7 @@ class _AppState extends State<App> with WidgetsBindingObserver {
// Android renders pushes locally, so a tap arrives via the local
// notifications callback (PushTapRouter) rather than onMessageOpenedApp.
PushTapRouter.pendingChatToken.addListener(_onPushTapPending);
PushTapRouter.pendingNewsletterId.addListener(_onNewsletterTapPending);
_onMessageSub = FirebaseMessaging.onMessage.listen((message) {
if (!mounted) return;
@@ -221,6 +229,7 @@ class _AppState extends State<App> with WidgetsBindingObserver {
_onMessageOpenedAppSub?.cancel();
_fcmTokenRefreshSub?.cancel();
PushTapRouter.pendingChatToken.removeListener(_onPushTapPending);
PushTapRouter.pendingNewsletterId.removeListener(_onNewsletterTapPending);
ShareIntentListener.pending.removeListener(_handlePendingShare);
ShareIntentListener.instance.detach();
Main.bottomNavigator.removeListener(_onTabControllerChanged);