Objective-c – Clearing the badge when received Push Notification

cocoa-touchiphoneobjective-cpush-notification

How can I clear the badge which appears on application icon when I receive Push Notification? I want to clear it once user has either tapped on "View" of Push notification alert or has tapped on the app icon.

Best Solution

I suspect you are talking about the SpringBoard's badge:

[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0]