Search code examples
iosuilocalnotificationnotificationcenter

Why calling cancelAllLocalNotifications removes/clears Notification Center?


Using cancelAllLocalNotifications should basically cancel the delivery of all scheduled local notifications. But it goes ahead and clear the history as well, and as a result the Notification Center doesn't show the last 1/5/10 recent items/notifications.

I'm not sure if it's a bug or is this intentional?

Perhaps i should use cancelLocalNotification: to cancel only scheduled local notifications (that are scheduled to fire in the future). But will that have an impact on the 64 local notifications limit?


Solution

  • I've reported this as a bug to Apple. Maybe it's intentional, and maybe not. I ended up using cancelLocalNotification: instead of cancelAllLocalNotifications.