0

So far I've found that I can't increment the app badge number through local notifications. So doing something like this:

self.notification.applicationIconBadgeNumber = [[UIApplication sharedApplication] applicationIconBadgeNumber]+1;

won't really work.

If I say for example the applicationIconBadgeNumber to be 7, it surely becomes 7, but if I set it like I'm doing over there, it just won't work.

rptwsthi
  • 10,094
  • 10
  • 68
  • 109
Devfly
  • 2,495
  • 5
  • 38
  • 56

1 Answers1

0

Tested it and was able to use [UIApplication sharedApplication].applicationIconBadgeNumber += 1 to increment. Is there a particular reason you were going through the UILocalNotification and not [UIApplication sharedApplication]?

[Update] Looked at the docs for UILocalNotification:

applicationIconBadgeNumber The default value is 0, which means "no change.” The application should use this property’s value to increment the current icon badge number, if any.

To me, this means that when handling a UILocalNotification, you should do:

[UIApplication sharedApplication].applicationIconBadgeNumber += notification.applicationIconBadgeNumber;
cscott530
  • 1,658
  • 16
  • 25