开发者

iOS reinstalling app does not clear badges

开发者 https://www.devze.com 2023-03-20 05:34 出处:网络
I have set the badge number of my app to 1 with a local not开发者_如何学Cification. 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 clea

I have set the badge number of my app to 1 with a local not开发者_如何学Cification. 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?

thanks.


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:

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.


As I know, iOS remembers badge value (which is appeared on the app icon). So you have to wait for a short period of time (1 day maybe), and then try to install it again.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号