4

We are using Firebase for sending remote push notifications, we are in need to grouping received notification like WhatsApp (Ex: 25 new messages received). I have tried it by adding APNs in JSON, but it's not working. Here is my tried code:

{
  "to" : "**FCM TOKEN**",
  "priority" : "high",
  "notification" : 
  {
    "title" : "You have a new message",
    "body"  : "Test",
    "badge" : 1
  },
  "apns":
  {
        "headers":
        {
            "apns-collapse-id":"***APNs ID***"
        }
  }
}

I'm receiving notification but not able to grouping it.apns-collapse-id which was taken from developer.apple.com.

halfer
  • 19,824
  • 17
  • 99
  • 186
Kavin Kumar Arumugam
  • 1,792
  • 3
  • 28
  • 47
  • 1
    apns-collapse-id is used to collapse messages into a single message on the APNs side. If the device is offline or unreachable for some reason and you send multiple notifications with the same apns-collapse-id when the device comes back online only the last message will be sent. You need to group your messages on the client side after they are received. – Arthur Thompson Jun 20 '18 at 15:22
  • 1
    @Kavin Kumar Arumugam any solution ? – Barak Feb 03 '20 at 14:35

0 Answers0