iOS remove notification from notification center

13,753

Set the applicationIconBadgeNumber property of your UIApplication instance to 0. That is,

[UIApplication sharedApplication].applicationIconBadgeNumber = 0;

Edit: In the current iOS SDK, you can't remove just a single notification from the Notification Center programatically.

Share:
13,753
mysho
Author by

mysho

Updated on June 04, 2022

Comments

  • mysho
    mysho almost 2 years

    Possible Duplicate:
    iOS application: how to clear notifications?

    is there a way how to remove notification from notification center(iOS 5) when I click it and start my application ? Thanks a lot

  • mysho
    mysho about 12 years
    This only remove number from app icon for me, but not clear notification center ... what is wrong ?
  • Praveen-K
    Praveen-K about 12 years
    Its a local notification or remote notification?
  • Adam Wright
    Adam Wright about 12 years
    After a bit of searching, I've found a dupe which is a much better answer than this. Have a look at my comment on your answer.
  • mysho
    mysho about 12 years
    Yes this is great, thanks a lot, but this solution clear all notifications from notification center and I want clear only notification which I click ...
  • Gruntcakes
    Gruntcakes over 11 years
    How come this is marked as the correct answer when you wanted to delete one notification and the answer deletes all of them? Did you find a way to delete only one notification?
  • Ganesh G
    Ganesh G over 11 years
    Hi, Am also having same problem. Is there any way to delete selected notification from the notification center?
  • Adam Wright
    Adam Wright over 11 years
    There's no supported way to remove exactly one notification. Stupid limit, but there we go.
  • Roger C S Wernersson
    Roger C S Wernersson over 11 years
    I had to add [[UIApplication sharedApplication] cancelAllLocalNotifications]; to get it to work.
  • Mitchel Kelonye
    Mitchel Kelonye over 9 years
    How do applications like Skype, Yo solve this problem?