How to correctly set application badge value in iOS 8?

In addition to Daij-Djan’s answer: it’s possible to stack the enums so you can request them all at once. Like follows:

UIUserNotificationSettings* notificationSettings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:notificationSettings];

Debug output mentions I should ask for Application Badge permission

Leave a Comment