问题
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?
回答1:
Apple actually responded and this is the expected behavior, the badge remains for a short period after uninstall (exactly for the case of an immediat re-install).
回答2:
Try to set:
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:-1];
in application: didFinishLaunchingWithOptions:
Worked fine for me.
来源:https://stackoverflow.com/questions/9314025/uiapplication-icon-badge-number-remains-at-re-install