4

I'm trying to implement APNS notification where i want to maintain single latest notification for all my incoming notification. I'm using apns-collapse-id which should be supported by FCM as described here

https://firebase.google.com/docs/cloud-messaging/concept-options#collapsible_and_non-collapsible_messages

However when i send multiple notification with single collapse-id the end use is still getting multiple notification

Below is the receiver end payload, which has "gcm.notification.apns-collapse-id" which i'm guessing is being sent by google.

I'm trying to understand if i need to make any changes to make it work.

Original Sender Payload:

{ 
"to" : "xyz",
"notification": {
    "title" : "title_here",
    "body" : "body_here",
},
"data" : {
    "message" : "Message_Here"
},
"apns-collapse-id" : "STRING_ID_HERE"
"content_available" : true
}

Receiver side Payload:

{
    aps =     {
        alert =         {
            body = "body_Here";
            title = "title_here";
        };
        "content-available" = 1;
    };
    "gcm.message_id" = "0:123456789ae";
    "gcm.notification.apns-collapse-id" = STRING_ID_HERE;
    "google.c.a.e" = 1;
    message = "Message_Here";
}
Sachin Hegde
  • 151
  • 10
  • 1
    I am facing the same issue have you resolved it? – Nav Nav Oct 02 '19 at 19:07
  • 14
    I resigned at that organization and changed my industry and moved to a different part of the country, Hope you find a better way to resolve this issue. – Sachin Hegde Oct 03 '19 at 20:39
  • It looks like an iOS bug to me, because when I swipe left to delete one of the duplicated notification from iOS Notification Center, the another one disappeared as well. So the iOS is actually identified them as the same notification. – Jonny May 18 '22 at 14:22

1 Answers1

0

I recommend using the latest send function from the firebase-admin lib, usage described here.

It seems to work fine.

eyalyoli
  • 1,677
  • 17
  • 16