IOS push notifications not being grouped - apn

635 views Asked by At

I am using apn push notificaitons from node server. I want to group same nature of notifications together. For that I am using threadId parameter but its still not grouping the notifications.

Here is my server side code:

var apnOptions = {

  token: {
    key:    "certificates/F5TRRQ26V.p8",
    keyId:  "F5TRRQ26V",
    teamId: "4ZGSRKDXH"
  },
  production: false 
};

var apnProvider = new apn.Provider(apnOptions);
var note        = new apn.Notification();

note.expiry     = Math.floor(Date.now() / 1000) + 3600; // Expires 1 hour from now.
note.badge      = 3;
note.sound      = "ping.aiff";
note.alert      = "\uD83D\uDCE7 \u2709 You have a new message";
note.payload    = { 'messageFrom': 'John Appleseed' };
note.topic      = "com.example.myapp";
note.threadId   = "870";

apnProvider.send(note, '5DA3C319EB50GDDGGAAA333DC9FE6DB240C34C66CBF1E547CD8307DCA15').then( (result) => {

  console.log(result); 
});

On IOS app side I am receiving this:

User Info =  [AnyHashable("thread-id"): 870, AnyHashable("threadId"): 870, AnyHashable("aps"): {
    alert = "\Ud83d\Udce7 \U2709 You have a new message";
    badge = 3;
    sound = "ping.aiff";
    "thread-id" = 870;
}, AnyHashable("messageFrom"): John Appleseed]

But still the notifications are not being grouped.

0

There are 0 answers