UIApplication 图标徽章编号在重新安装时仍保留
重新安装时不会删除 UIApplication 徽章编号。
如果我在徽章具有非零值时卸载应用程序,然后重新安装它,徽章仍会出现在新安装中。
我通过以下方式更新徽章编号:
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:badgeNumber];
尝试找到解决方案 - 应用程序终止时发出一些通知,以便我可以删除徽章...无法使用 applicationWillTerminate 来完成。有什么建议吗?
The UIApplication badge number is not deleted at reinstall.
In case I uninstall the application when the badge has a non zero value, and then re-install it, the badge still appears in the new installation.
I update the badge number in the following manner:
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:badgeNumber];
Tried to find a solution - some notification when the application terminates so I can remove the badge... Couldn't make it with applicationWillTerminate. Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
苹果实际上做出了回应,这是预期的行为,卸载后徽章会保留很短一段时间(恰好适用于立即重新安装的情况)。
Apple actually responded and this is the expected behavior, the badge remains for a short period after uninstall (exactly for the case of an immediate re-install).
尝试设置:
在
application: didFinishLaunchingWithOptions:
对我来说效果很好。
Try to set:
in
application: didFinishLaunchingWithOptions:
Worked fine for me.