How to clear push notification badge count in iOS?

You should set this:

[UIApplication sharedApplication].applicationIconBadgeNumber = 0;

in
either of these AppDelegate methods if the application is launched and sent to background then you launch the application didFinishLaunchingWithOptions method will not be called so use either of these methods:

- (void)applicationWillEnterForeground:(UIApplication *)application

- (void)applicationDidBecomeActive:(UIApplication *)application

For Swift 3+

- func applicationWillEnterForeground(_ application: UIApplication)
- func applicationDidBecomeActive(_ application: UIApplication)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)