Skip to content. | Skip to navigation

Personal tools

Sections

Things to remember UILocalNotification

| filed under: ,

This is mostly notes to self regarding missing documentation details on UILocalNotification.

  • You can not (under normal circumstances) and should not try to delete past notifications from the notification pane.

    [UIApplication scheduledLocalNotifications] only returns future notifications. These can be deleted before they fire. Notifications which have already fired are up to the user to delete unless the app badge is set to 0 in which case all app notifications are removed from the notification pane. "In for a penny, in for a pound."

  • [UILocalNotification applicationIconBadgeNumber] Apple documentation states - The number to display as the app’s icon badge.

    What this leaves out is they really mean the one number to show on the badge when that particular notification fires. This means your app needs to calculate this number every time it schedules a new local notification. This calculation needs to be something like, take the number of past due notifications and add one for each new notification being schedule and make sure the incrementing is happening in chronological order if the fireDate is being set.

  • Tapping on a notification in the notification pane will cause that notification to disappear even if the app does not deal with the cause for the notification.

Filed under: ,
Add comment

You can add a comment by filling out the form below. Plain text formatting. Comments are moderated.