Resetting Notification App Icon Badge Number

I am trying to reset the application icon badge number for a notification in my game, but I do not know the correct way to do so. Is setting the applicationIconBadgeNumber of the notification to 0 a way? Because I tried that and the badge did not go away.

It is using LocalNotification. Here is how I display the notification:

LocalNotification notif = new LocalNotification();

 

                        notif.fireDate = energyRefillTime.Value;

 

                        notif.alertBody = "You have more lives!";

 

                        notif.alertAction = "The wait is over!";

 

                        notif.soundName = LocalNotification.defaultSoundName;

 

                        notif.applicationIconBadgeNumber = 1;

 

                        NotificationServices.ScheduleLocalNotification(notif);

Here is how I am trying to reset and clear the application icon badge number:

notif.applicationIconBadgeNumber = -1;

I have also tried:

NotificationServices.CancelAllNotifications(); 

NotificationServices.ClearAllNotifications();

Both have not worked.

Please help! Thank you in advance.

Ahh, though its an old thread. But still, if it may help someone:

void ResetAppBadgeIcon() { LocalNotification setCountNotif = new LocalNotification(); setCountNotif.applicationIconBadgeNumber = -1; setCountNotif.hasAction = false; NotificationServices.PresentLocalNotificationNow(setCountNotif); }

Works perfectly for me. :slight_smile: