Kirankumar Dafda
Kirankumar Dafda

Reputation: 2384

Cordova Push notifitication badge not displaying on app icon iOS

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

Answers (2)

Sadikhasan
Sadikhasan

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

Mahesh Agrawal
Mahesh Agrawal

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.

reference - https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html

Upvotes: 1

Related Questions