ApplicationIconBadgeNumber不会重新安装我的ipad应用程序重置。 [英] ApplicationIconBadgeNumber is not getting reset on reinstallation of my ipad app.

查看:443
本文介绍了ApplicationIconBadgeNumber不会重新安装我的ipad应用程序重置。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用此代码设置我的applicationIconBadgeNumber:

I'm setting my applicationIconBadgeNumber using this code:

[[UIApplication sharedApplication] setApplicationIconBadgeNumber:theIntToDisplay];

问题是,当我从iPad中删除应用程序并重新安装它时,应用程序图标仍显示以前的徽章编号。这是默认的iOS行为还是我们可以重置它?

The problem is that when I delete the app from an iPad and reinstall it, the app icon still shows the previous badge number. Is this default iOS behavior or can we reset it?

我在

I found one similar question on at Why the applicationIconBadgeNumber is not getting deleted with appliccation ? Where it stored actually?, but it didn't answer my question.

推荐答案

这是一个预期的行为,在卸载之后,例如对于立即重新安装的情况,徽章号保持很短的时间。

当然,您可以在应用程序:didFinishLaunchingWithOptions:方法中每次启动应用程序后,撤销徽章号,但我认为不是这样,因为您想要徽章数字不显示后,你安装应用程序,还没有启动它。在这种情况下,只需等待删除应用程序,并且徽章数字缓存将被iOS清除,然后再次安装应用程序。不幸的是,如果没有越狱设备,就无法手动管理徽章号码行为

This is an expected behavior, the badge number remains for a short period after uninstall e.g for the case of an immediate re-install.

Of course you can nullify badge number after every launching the application in application:didFinishLaunchingWithOptions: method but I think it is not the case because you want badge number not to be shown right after you install app and not yet launch it. In such a case just wait after removing the application and the badge numbers cache will be cleared by iOS and then install the app again. Unfortunately without jailbreaking the device there is no way to manage badge numbers behavior manually

这篇关于ApplicationIconBadgeNumber不会重新安装我的ipad应用程序重置。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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