iOS重新安装应用程序无法清除徽章 [英] iOS reinstalling app does not clear badges

查看:76
本文介绍了iOS重新安装应用程序无法清除徽章的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已通过本地通知将我的应用的徽章编号设置为1.然后,我卸载了该应用程序.当我重新安装它时,徽章仍然存在.这是iOS的错误,还是卸载后可以清除标志的方法?

I have set the badge number of my app to 1 with a local notification. Then I uninstall the app. When I reinstall it the badge is still there. Is this an iOS bug or is there a way to clear the badges when it gets uninstalled?

谢谢.

推荐答案

徽章计数由操作系统维护,与应用程序无关.卸载(删除)应用程序后,操作系统会保留一些值,包括直到一天的徽章计数.卸载应用程序后,不会调用任何开发人员方法或脚本.实际上,苹果公司对此事有技术说明:这是摘录自 Apple的有关推送通知的官方技术说明:

The badge count is maintained by the operating system, independent of the app. When an app is uninstalled (deleted), some values are retained by the operating system, including the badge count until a day. When the app is uninstalled, no developer method or script is called. Actually there is a technical note from Apple about the matter: Here is the excerpt from Apple's official Technical Notes about push notifications:

启用推送功能的应用首次注册推送通知时,iOS询问用户是否希望接收该应用程序的通知.用户响应此警报后,将不会再显示该警报除非设备已还原或已在卸载了该应用至少一天.如果要模拟应用程序的首次运行,可以将应用程序卸载一天.您可以实现后者通过执行以下步骤,实际上无需等待一天的时间:

The first time a push-enabled app registers for push notifications, iOS asks the user if they wish to receive notifications for that app. Once the user has responded to this alert it is not presented again unless the device is restored or the app has been uninstalled for at least a day. If you want to simulate a first-time run of your app, you can leave the app uninstalled for a day. You can achieve the latter without actually waiting a day by following these steps:

  1. 从设备上删除您的应用.
  2. 完全关闭设备,然后重新打开.
  3. 转到设置">常规">日期和时间";安排时间并将日期提前一天或更长时间.
  4. 完全关闭设备,然后重新打开.

这篇关于iOS重新安装应用程序无法清除徽章的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆