0

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];
} 

1 Answer 1

3

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;
} 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.