gpt4 book ai didi

iOS 重新安装应用程序不会清除角标(Badge)

转载 作者:IT王子 更新时间:2023-10-29 08:15:15 24 4
gpt4 key购买 nike

我已通过本地通知将我的应用程序的角标(Badge)编号设置为 1。然后我卸载应用程序。当我重新安装它时,角标(Badge)仍然存在。这是 iOS 错误还是有办法在卸载时清除角标(Badge)?

谢谢。

最佳答案

角标(Badge)计数由操作系统维护,独立于应用程序。卸载(删除)应用程序时,操作系统会保留一些值,包括角标(Badge)计数直到一天。卸载应用程序时,不会调用任何开发人员方法或脚本。实际上,苹果公司有一份关于此事的技术说明:这是 Apple's official Technical Notes about push notifications 的摘录:

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. Delete your app from the device.
  2. Turn the device off completely and turn it back on.
  3. Go to Settings > General > Date & Time and set the date ahead a day or more.
  4. Turn the device off completely and turn it back on.

关于iOS 重新安装应用程序不会清除角标(Badge),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6700783/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com