简体   繁体   English

收到远程通知时,iOS 8图标徽章未更新

[英]iOS 8 icon badge not updating when receiving remote notification

I am developing an iOS app that uses remote notifications. 我正在开发使用远程通知的iOS应用。 All works fine but I have noticed that the icon badge doesn't show any number when a notification is received. 一切正常,但我注意到收到通知时图标徽章没有显示任何数字。

I ask for permissions in this way in my AppDelegate: 我以这种方式在AppDelegate中请求权限:

[application registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
[application registerForRemoteNotifications];

Is there anything more that I have to do? 还有什么我需要做的吗?

Thanks! 谢谢!

推送通知有效负载应包含带有"badge"键的值,该值将自动更新应用程序图标的徽章。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM