Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ApplicationIconBadgeNumber is not getting reset on reinstallation of my ipad app.

I'm setting my applicationIconBadgeNumber using this code:

[[UIApplication sharedApplication] setApplicationIconBadgeNumber:theIntToDisplay];

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.

like image 272
Ramanuj Singh Avatar asked Jul 18 '13 19:07

Ramanuj Singh


People also ask

How to fix iPhone or iPad cannot be restored problem?

To solve the iPhone or iPad cannot be restored problem, you can follow 5 solutions below to get detailed information. Way 1. Restore and update iPad with best alternative to iTunes Way 2. Perform a Force Restart When You Can't Restore iPad Way 3. Check Wi-Fi Condition or Reset Network Settings to Fix an iPad That Can't Connect to Wi-Fi Way 4.

How to fix iPad won't reset to factory settings?

After getting iPad into the DFU or Recovery mode, you will see you are going to the model information checking interface. Just click the "Back" option and select "Advanced Mode" and "Confirm" button to start to download the firmware and restore your iPad to factory settings. Moreover, this software also can help you the following issues:

How to fix “iPad won’t turn on” error?

Actually, these iPhone or iPad errors also represent different meanings. Step 1. Press and hold Home button and Power button at the same time. Step 2. Continue holding two buttons until the Apple logo appears. Step 3. Wait and reboot your iPad successfully. Way 3.

What is a restart on an iPad called?

A restart is sometimes called a reset. A hard reset is used when the standard restart process doesn't work. To hard reset, hold down the home and on/off buttons at the same time, even after the slider appears. This article explains how to restart an iPad and how to hard reset an iPad. It covers every iPad model ever released.


2 Answers

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

like image 94
Oleksandr Karaberov Avatar answered Oct 16 '22 06:10

Oleksandr Karaberov


In your app delegate under:

- (void)applicationWillEnterForeground:(UIApplication *)application
{

}

Insert:

application.applicationIconBadgeNumber = 0;
like image 26
Abdullah Shafique Avatar answered Oct 16 '22 07:10

Abdullah Shafique