I'd used
[UIApplication sharedApplication].applicationIconBadgeNumber = 5;
for setting application badge number. It's not working in ios 9 alone.
Can anyone suggest why?
I tried,
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:5];
解决方案
Hi You need to register UIUserNotificationSettings like this
UIUserNotificationSettings* notificationSettings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:notificationSettings];
[UIApplication sharedApplication].applicationIconBadgeNumber = 1;