Reputation: 2384
I am using cordova push plugin where I am getting notification and all data I needed, but also I want to set badge as per the unread notification or the number i am getting into count of push notification but I am not sure why I am not getting this count as a badge into app icon of iOS device
Here is the json format I am getting into push notification success function
{
"count":"1",
"sound":"default",
"additionalData":{
"foreground":true,
"product_id":"19",
"user_id":"2",
"coldstart":false,
"notificationstatus":"like"
},
"message":"Username likes your product"
}
Sound and message both were working perfect but not count.
Any suggestion ?
Upvotes: 0
Views: 826
Reputation: 18600
I noticed that, there is a string value of count
in the response, and it was the mistake.
Count value must be an integer
.
Hope this will help others too.
Upvotes: 1
Reputation: 3358
what you receiving is ok but one key is wrong. the key count
should be badge
. This is the problem i think. Try to change the key and reply the result.
Upvotes: 1