zdolniacha zdolniacha - 1 month ago 6x
Objective-C Question

Clear notifications badge without removing notifications

In my app, I'm receiving push notifications with badge number set to one.
When app will start, it should set badges count to 0, so I'm using:

[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];

And it works, but also it removes all notifications from notifications center.

Is there a way to clear badges without removing notifications?


According to this topic:

How to clear badge number while preserving notification center


[[UIApplication sharedApplication] setApplicationIconBadgeNumber:-1];

should do the trick.