8

I tried the Re.minder app and noticed that it can repeat reminders with custom intervals (such as every 3 minutes, every 2 hours, every 4 days,...).

How can I do that?

swiftBoy
  • 35,607
  • 26
  • 136
  • 135
Arnol
  • 2,107
  • 2
  • 17
  • 19

1 Answers1

23

Thanks for trying our app! It turns out, we're not actually using UILocalNotification repeatInterval to accomplish that. Given it's limitations (only one NSCalendarUnit), we actually wrote our own scheduler. This has it's own limitations, mainly the 64 local notification queue limit per app. We essentially schedule and build our own queue, then fill the local notifications from that. Any time the user launches or makes a change in the app we reschedule.

Hope that helps!

swiftBoy
  • 35,607
  • 26
  • 136
  • 135
Jeremy Handel
  • 231
  • 1
  • 2
  • 2
    What do you do if the queue gets to the end, and the user hasn't run your app in-between? Do you use the last notification to tell the user that, or do you use some other trick? – Jordan Smith Nov 23 '11 at 00:12
  • @Jordan, I supposed what Jeremy meant is that they use single shot notifications with no repeat interval whatsoever. Thus if the user choose to clear one "repeating alarm", he won't be notified again until the app get a chance to rerun. Typically you can also put a longer notification to tell the user that the app hasn't been run for a while, and notifications may be missed. – He Shiming May 09 '12 at 08:03
  • Do you think there's any promise in providing an NSCalendar subclass? The 64 notification limit is actually a problem for my purposes. My client would ideally like to schedule one for example every 25 minutes from 9:00-5:00 M-F. I could do this simply enough if the limit wasn't there, but is there any value or possibility of creating a custom calendar that thinks Friday is 72 hours long and scheduling a notification for each 25 minutes between 900 to 1700 hours with a daily repeat? When it's "4000 hours" on Friday, it wouldn't go off. – Jason Newell Jul 19 '14 at 21:12
  • @JasonNewell Hi Jason, Did you manage to solve your problem here? As I am having a very similar one and can't seem to work it out either – Henry Brown Oct 18 '15 at 14:50
  • @HenryBrown any solution found?? – Hardik Amal Apr 01 '16 at 09:44