diff --git a/lib/services/notification/notification_service.dart b/lib/services/notification/notification_service.dart index 93659e8..e2bdabe 100644 --- a/lib/services/notification/notification_service.dart +++ b/lib/services/notification/notification_service.dart @@ -259,6 +259,12 @@ class NotificationService { // - otherwise → MessagingStyle (compact) final useBigPicture = notifType.contains('1') || bigPicturePath != null; + // Use the same tag the backend put on the FCM notification so this + // local notification REPLACES the bare one Android already drew when + // the push arrived — no duplicate, just the cover image. + final notifTag = + (data.id != null && data.id!.isNotEmpty) ? 'didvan-content-${data.id}' : null; + final AndroidNotificationDetails androidPlatformChannelSpecifics = AndroidNotificationDetails( 'content', @@ -267,6 +273,7 @@ class NotificationService { importance: Importance.max, priority: Priority.high, playSound: true, + tag: notifTag, styleInformation: useBigPicture && bigPicturePath != null ? BigPictureStyleInformation( FilePathAndroidBitmap(bigPicturePath),