I want to clear the push notification badge count once app is launched.Im not clear where to set the below code.Please give brief description about clearing the badge count.
[UIApplication sharedApplication].applicationIconBadgeNumber = 0;
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)