4

i'm working with UILocalNotification, and i have read the apple documentation about it at this link:

http://developer.apple.com/library/ios/#documentation/iphone/Reference/UILocalNotification_Class/Reference/Reference.html

but my question is how many notification i can schedule?...because here there write this:

the system keeps the soonest firing 64 notifications (with automatically rescheduled notifications counting as a single notification) and discards the rest.

so what this lines means?...i can schedule more than 64 notification or not? i don't want fire 64 at the same time, i only want schedule more than 64 notification...and then fire it when it's the firetime...

WrightsCS
  • 50,551
  • 22
  • 134
  • 186
Piero
  • 9,173
  • 18
  • 90
  • 160

2 Answers2

8

You can schedule n number of notifications, if n is more than 64, only the soonest notifications will be scheduled, the rest will be lost.

That 64 notifications will be fired depending on the fireDate property. It doesn't matter wheter the notifications fireDate is the same.

Tha confusing part may be:

(with automatically rescheduled notifications counting as a single notification)

If you use the repeatingInterval property you can schedule "more" than 64 notifications using a NSCalendarUnit.

Handling more than 64 scheduled notifications can be managed by creating your own queue of notifications. I explain how to do it here.

Community
  • 1
  • 1
Eduardo
  • 1,383
  • 8
  • 13
  • i read your explanation about creat own queue of notification, you refill the queue of every notification type when they decreased, but my question is if the user don't open the app for weeks, i can rescheduled it, and i can refill, and i have only 64 notification, and your own queue don't work...right? – Piero Apr 30 '12 at 22:24
  • Yes, my solution will work only when the user opens the app, because I use the delegate to fill que queue. In my app I scheduled the notifications for the next month and I'm hoping for the user to open at least the app once in the next month. If you really need to scheduled more than 64 notifications at the same time consider using repeating intervals. – Eduardo Apr 30 '12 at 22:31
1

It seems that in iOS 8.1 it is possible to schedule more than 64 notifications per app and all get fired. In my app I tested it with 500 and more local notifications and all get scheduled and fired on iPhone Simulator an on a real iPhone 5s. Maybe this is a bug in iOS 8.1 or Apple forgot to update the documentation.