Reputation: 125
I'm currently developing an app where I can send push notifications to my users via parse.com. I have got the sending and receiving part working just fine but when you open the app, dosen't matter from which state, nothing happens. And also the badge doesn't go away. In my AppDelegate.m I let parse handle the push notifications like this:
- (void)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)userInfo {
[PFPush handlePush:userInfo];
}
Upvotes: 0
Views: 1193
Reputation: 1044
Use below code which will clear the badge count to zero
- (void)applicationDidBecomeActive:(UIApplication *)application
{
application.applicationIconBadgeNumber = 0;
}
or do following while handling push notification
-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
[PFPush handlePush:userInfo];
application.applicationIconBadgeNumber = 0;
}
Upvotes: 3