LocalNotification limit

Viewed 2126

I know Apple puts a limit of the number of local notifications at 64. After reading Apple's docs, some posts on SO and blogs... I am a bit confused.

Is it:

  1. You can only schedule 64 total notifications for the app ever.
  2. You cannot have more than 64 notifications scheduled at one time.(do they delete automatically after the fireDate?
2 Answers

Yes, when notification is firing its deleting automatically. So you can schedule another notifications. If you set more than 64 notifications the first one will be removed with the new one. So be careful. I've solved this problem with scheduling only 60 notifications and when user entering in app - remove all notification and scheduling new 60 notification again in applicationWillTerminate. For my app it's approximately a week of notifications. Also you can try to use background fetch to update your notifications. You can find more info about background fetch in Ray Wenderlich tutorial for background modes

Related