转 How to correctly set application badge value in iOS 8?
时间:2014-09-15 15:31:19
收藏:0
阅读:215
o modify the badge under ios8 you have to ask for permissions
let settings = UIUserNotificationSettings(forTypes: UIUserNotificationType.Badge, categories: nil)
UIApplication.sharedApplication().registerUserNotificationSettings(settings)
or in objC
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeBadge categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:settings];
原文:http://www.cnblogs.com/liangjialun219/p/3972832.html
评论(0)