Removing badge from iOS app icon Removing badge from iOS app icon ios ios

Removing badge from iOS app icon


If your app becomes active again and is still in the background you should reset the badge count in -applicationDidBecomeActive: as well:

- (void)applicationDidBecomeActive:(UIApplication *)application{    application.applicationIconBadgeNumber = 0;}

If your app is still running in the background -application:didFinishLaunchingWithOptions: won't be called.


Likely, -application:didFinishLaunchingWithOptions: is not being called, because your app is still running in the background. In order to remove the badge count when the app is launched from the background you'll have to reset the badge number in -applicationWillEnterForeground:, too.


In Swift and In AppDelegate

func applicationDidBecomeActive(_ application: UIApplication) {    application.applicationIconBadgeNumber = 0}