Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIApplication icon badge number remains at re-install [duplicate]

The UIApplication badge number is not deleted at reinstall.

In case I uninstall the application when the badge has a non zero value, and then re-install it, the badge still appears in the new installation.

I update the badge number in the following manner:

[[UIApplication sharedApplication] setApplicationIconBadgeNumber:badgeNumber];

Tried to find a solution - some notification when the application terminates so I can remove the badge... Couldn't make it with applicationWillTerminate. Any suggestions?

like image 693
yaara4 Avatar asked Feb 16 '12 15:02

yaara4


People also ask

What is iOS notification badge count?

The iOS badge count displays the number of unread notifications within your application, taking the form of a red circle in the upper-right hand corner of the app icon. In recent years, badging has come to be an effective means for re-engaging app users.

How do I get notification number for app icon on iPhone?

Step 1: Launch the Settings app on your iPhone or iPad. Step 2: Tap Home screen. Step 3: In the Notification badges section, toggle on the switch for Show in App Library. Step 4: If seeing the badge in your App Library is preferable, just switch the toggle back on for the full effect.

What is badge count?

Badge Count reflects all unread mail from your mail account(s), or just unread mail in your Focused Inbox.


2 Answers

Apple actually responded and this is the expected behavior, the badge remains for a short period after uninstall (exactly for the case of an immediate re-install).

like image 129
yaara4 Avatar answered Sep 20 '22 20:09

yaara4


Try to set:

[[UIApplication sharedApplication] setApplicationIconBadgeNumber:-1];

in application: didFinishLaunchingWithOptions:

Worked fine for me.

like image 43
mnickv31 Avatar answered Sep 18 '22 20:09

mnickv31