2 yinwanmei yinwanmei 于 2015.07.14 11:22 提问

关于修改应用程序图标右上角的数字提示问题

遇到这错误:Attempting to badge the application icon but haven't received permission from the user to badge the application,请问如何解决

2个回答

kebing1011
kebing1011   2015.07.14 11:36
已采纳
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
{
    [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings
                                                                         settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge)
                                                                         categories:nil]];
}

这个在iOS上要用户授权。
然后才能使用。

yinwanmei
yinwanmei 谢谢你能在百忙当中抽空为我解答
2 年多之前 回复
kebing1011
kebing1011   2015.07.14 11:35
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
{
    [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings
                                                                         settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge)
                                                                         categories:nil]];
}

这个在iOS上要用户授权。
然后才能使用。

Csdn user default icon
上传中...
上传图片
插入图片