I'm using UILocalNotification
s in my app. Sometimes I schedule a repeating notification and sometimes a non-repeating notification. Whenever a notification fires I want to increment the app badge number. So I do localNotification.applicationIconBadgeNumber = badgeNumber;
this works fine... except when the notification is a repeating notification because if I have previously set a repeating notification with badge number 1, then I set another non-repeating notification with badge number 2.
Flow is this:
Notification 1 fires (first time) - Badge number = 1 (OK!)
Notification 2 fires - Badge number = 2 (OK!)
Notification 1 fires (repeating) - Badge number = 1 (ERROR)
As you understand when notification 1 fires again I still want the app badge number to be displaying 2 (for 2 missed notifications). Can I possibly achieve this behaviour? Or is there something obvious that I have missed? For me the more logical badge behaviour for a repeating notification would be that it for the first time sets the badge number and for subsequent times it will not change the badge number.