am working on push notifications app but badge count is not increasing when notification comes.
i have saw so many examples in stack overflow
Usually in all apps, the unread notification counts are maintained in the server. When the server sends a push notification to a particular device token server sends the badge count along with the payload.
Your server logic needs to keep track of the proper badge count and send it appropriately.
{
"aps" :
{
"alert" : "Your notification message",
"badge" : badgecount ,
"sound" : "bingbong.aiff"
}
}
EDIT
You have set badge count in didReceiveRemoteNotification method. before this method called appbadgeis set from pushnotification, so from server you have to set correct badge..
Solution:
so create some webservice send deviceToken and currentBadge in that webservice to store at server, and when next time you send push check the last badge value for the token, and send it.