简体   繁体   English

首次安装时,应用程序图标徽章计数显示为2

[英]Application Icon badge Count is showing 2 for the first install

I am using UILocalNotifications in my application, When i am launching the app for the first time badge count on app icon shows 2. Same thing is happening when i installed the app with IPA file.if i opened the application once and enters in to background then no badge count is showing. 我在我的应用程序中使用UILocalNotifications,当我第一次启动该应用程序时,应用程序图标上的徽章计数显示2。如果我使用IPA file.if安装该应用程序,一次打开该应用程序并进入后台,则发生相同的情况则没有显示徽章计数。 I am using the following code to set the badge count to 0 for the first time. 我正在使用以下代码将徽章计数首次设置为0。

 if ( ! [[NSUserDefaults standardUserDefaults]boolForKey:@"FIRSTRUNCOMPLETE"] ) {
[UIApplication sharedApplication].applicationIconBadgeNumber=0;
[[NSUserDefaults standardUserDefaults]setBool:YES forKey:@"FIRSTRUNCOMPLETE"];

What should i do to make the badge count as 0 for the first installation. 我应该怎么做才能使徽章在首次安装时计数为0。

This usually happens when you deleted the app (while it was showing some badge number), and re-installed it again. 这通常发生在您删除该应用程序(它显示一些徽章编号)并再次重新安装时。 It should not show after the app has completed running for the first time after install. 安装后首次运行该应用程序后,它不应显示。 If you still see the badge after setting applicationIconBadgeNumber , then the problem could be somewhere else. 如果在设置applicationIconBadgeNumber之后仍然看到徽章,则问题可能出在其他地方。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM