Push notification badge count not showing on android


#1

Hello

Ionic 2 push notification icon badge not indicating the count in ANDROID devices.

01. Cloud Setting
const cloudSettings: CloudSettings = {
‘core’: {
‘app_id’: ‘XXXXXX’,
},
‘push’: {
‘sender_id’: ‘XXXXXXXXX’,
‘pluginConfig’: {
‘ios’: {
‘badge’: true,
‘sound’: true
},
‘android’: {
‘iconColor’: ‘#fff’,
}
}
}
};

02. API POST: https://api.ionic.io/push/notifications
{
“tokens”: [TOKEN]
“profile”: “PROFILETAG”,
“production”: false,
“notification”:
{
“message”:“Hi this is a push notification”,
“title”: “Rio”,
“android”: {“payload”: {“sound”: “false”,“badge”: “1”}},
“ios”: {“payload”: {“sound”: “true”,“badge”: "1}}
}
}

please anyone help me on this.


#2

I think you should set “badge”: 1 out of payload.

{
    "tokens": [TOKEN]
    "profile": "PROFILETAG",
    "production": false, 
    "notification":
{ 
    "message":"Hi this is a push notification", 
    "title": "Rio", 
    "android": 
    {
          "badge": "1",
          "payload": {"sound": "false"}
    }, 
    "ios": 
     {
          "badge": "1,
          "payload": {"sound": "true"}
     }
}
}