use FCM-matching tag so local notif replaces Google's bare push
This commit is contained in:
parent
6eb00ea786
commit
2253c71338
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Reference in New Issue