cordova - Ionic Android Notifications Stacking -


issue

notifications not stack in tray when sent android devices, instead overwrite previous unread notification belonging same app.

notification payload being sent ionic.

{      "send_to_all":true,    "profile":"dev",    "notification":{         "title":"title",       "message":"test message 2!",       "android":{            "collapsekey":true,          "stack":4,          "payload":{               "type":"annoucement"          },          "sound":"default"       }    } } 

notification object received ( viewed locally using adb logcat):

{      "sound":"default",    "title":"title",    "message":"test message 2!",    "additionaldata":{         "payload":{            "type":"annoucement"       },       "google.message_id":"0:1470668857644329%e03d0952f9fd7ecd",       "collapse_key":"do_not_collapse",       "foreground":true    } } 

i tried setting notid recommended in push plugin docs , sent multiple notifications unique notid follows:

input ionic api:

{      "send_to_all":true,    "profile":"dev",    "notification":{         "title":"title",       "message":"test message 2!",       "android":{            "collapsekey":true,          "stack":4,          "payload":{               "type":"annoucement"          },          "sound":"default",         "data": {             "notid": 2         }       }    } } 

output seen in logcat

{      "sound":"default",    "title":"title",    "message":"test message 2!",    "additionaldata":{         "payload":{            "type":"annoucement"       },       "data":{            "notid":2       },       "google.message_id":"0:1470670019771364%e03d0952f9fd7ecd",       "coldstart":false,       "collapse_key":"do_not_collapse",       "foreground":false    } } 

as can see there no indication ever regarding stacking here makes sense not working, can point out doing wrong or bug.

if send notification "collapse_key" , send new notification collapse_key having same value, gcm (server) overrides older notification , sends newest notification. remove "collapse_key" field.

you can more information on topic reading "collapsible messages" here


Comments