Clear badge count without removing notifications from notification center?

So I've read that to clear notifications out of the notification center, you simply use

setApplicationIconBadgeNumber
and set the value to 0. What if we wanted to clear the badge count without clearing the notification center messages? Is there a way to clear the badge count without removing the notifications?

Accepted Answer

Figured it out, the solutionw as to set the value to -1

Answers

Figured it out, the solutionw as to set the value to -1

Hi,


@tlindeman, with which iOS version have it worked? I have tried with an iOS8 and it doesn't works (at least for me) :S


Thank you

I've also tried this solution on iOS 9 and it doesn't work. Is there another way to achieve this? In my app, there could be a lot of push notifications, but I don't want to be showing the badge number forever. But notifications are useful, so we don't want to loose them either. Any help would be appreciated. Thanks!

This does not work anymore since iOS 11 (tested with iOS 11.1). Is there a solution?

Hmm, not work for me, test device: iOS10.3.3, 5s.