문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top