We have developed an ios app using phonegap and have implemented push notification functionality in our app. Push notification works perfectly fine for us. We have configured push notification for both (alerts and badge) and both works fine. When we click on the alert list it redirects us to the application and clears all the notifications from the alert list and also the badge counter is set to 0.
But when we click on the application icon(badge counter) it brings app to the foreground but the badge counter and alerts are not getting cleared.
We have used following code in didFinishLaunchingWithOptions method (in appdelegate.m file)that clears out the alerts and resets the badge only on-click of alerts
application.applicationIconBadgeNumber = 0;
can anyone provide us the solution that shows same behaviour when we click on app icon with badge counter.