use FCM-matching tag so local notif replaces Google's bare push

This commit is contained in:
Mohamad Mahdi Jebeli 2026-06-22 13:56:57 +03:30
parent 6eb00ea786
commit 2253c71338
1 changed files with 7 additions and 0 deletions

View File

@ -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),