关闭

Attempting to badge the application icon but haven't received permission from the user to badge the

标签: IOSapplication
283人阅读 评论(0) 收藏 举报

报错Attempting to badge the application icon but haven't received permission from the user to badge the application


因为在iOS 7.1之后,设置应用的application badge value需要得到用户的许可,需要判读iOS版本


#ifdef SUPPORT_IOS8

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) {


    UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeBadge categories:nil];


    [[UIApplication sharedApplication] registerUserNotificationSettings:settings];

   

}

#endif


0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:36323次
    • 积分:1079
    • 等级:
    • 排名:千里之外
    • 原创:76篇
    • 转载:0篇
    • 译文:0篇
    • 评论:2条