2

My app is queuing local notifications (and can also receive APNs) and the app's icon badge is getting set as a consequence.

When the app launches I want to clear the icon badge but I want the notifications to remain in the notification center history lists. But it seems this isn't possible? Setting the badge count to 0 has the effect of removing all notifications from the notification center.

Is there any way I can leave them there so it is the user's responsibility to remove them, yet at the same time clear the app's badge?

Gruntcakes
  • 37,738
  • 44
  • 184
  • 378

1 Answers1

5

No, unless something has recently changed, the notifications in Notification Center are tied to the applications icon badge.

This code reads like it should clear only the badge, however, it is commonly used to clear the notifications in Notification Center:

[UIApplication sharedApplication].applicationIconBadgeNumber = 0; 

However, when the code is used, the Notification Center notifications are cleared as well. Notification Center reads what to display based on what is displayed on the icon.

Sources:

Community
  • 1
  • 1
Nathan
  • 1,135
  • 2
  • 12
  • 27
  • Thx! Helped me a lot. The ios Notification Center is so bad compared to the latest android. It is not well documented, it has no features, it feels like MS in the 90's. – Janning Vygen Dec 06 '16 at 14:02