Question

I don't want to see the badge number on the app icon. but I want to keep the notifications in notification center.

How to achieve this?

The following doesn't work as it clears all the notifications in the notification center.

[UIApplication sharedApplication].applicationIconBadgeNumber = 0;

The following doesn't work as well, as it only remove the badge counter after the app is opened.

[UIApplication sharedApplication].applicationIconBadgeNumber = -1;

I am thinking is it possible to push a negative badge number with a value of -1?

Was it helpful?

Solution

You should be able to specify what the desired badge number is when you send the push notification. From Apple's Local and Push Notification Programming Guide, if you send a number with "badge" as the key.

The number to display as the badge of the application icon. If this property is absent, the badge is not changed. To remove the badge, set the value of this property to 0.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top