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"
}
}
and instead in your code [[UIApplication sharedApplication]setApplicationIconBadgeNumber:1];
use
badge_value+=[[[userInfo objectForKey:@"aps"] objectForKey:@"badge"]intValue];
[UIApplication sharedApplication].applicationIconBadgeNumber = badge_value;
where, badge_value is an integer that stores the badge value.