• iOS
  • Swift
  • notifications

A year of reminders under iOS’s 64-notification limit

iOS keeps at most 64 pending notifications per app and cannot repeat one by lunar date. How Luminder merges reminders by day and keeps the queue topped up.

Luminder reminds people of dates on the lunar calendar: a grandparent’s memorial day, a lunar birthday, the 1st and 15th of every lunar month. Reminders are the reason the app exists, and on iOS they run into two hard limits. This post describes both and the scheduling scheme Luminder uses to live with them.

Two limits

No lunar repeats. A local notification can repeat on the solar calendar, but iOS has no way to say “every 15th of the lunar month”. The lunar 15th lands on a different solar date every month. So each occurrence has to be its own notification with its own solar date and time.

64 pending requests per app. iOS keeps at most 64 pending notification requests for an app, so an app cannot simply queue every future occurrence.

Put together: a user with the 1st and 15th turned on, plus a few memorial days with a notice three days ahead, needs dozens of separate notifications per year. With one notification per reminder, the 64 slots run out in a few months.

One notification per day

The first step is to stop thinking in reminders and start thinking in days. Luminder computes every occurrence first: one-time, monthly and yearly reminders, the monthly templates (1st, 15th, last day of the month and so on), and the advance notices one or three days before. Then it groups them by solar date. Each day that has at least one event gets exactly one notification, at the reminder time the user picked (07:00 by default, in the device’s local time), listing everything for that day.

This matches how people use the app anyway. If the 15th is also a memorial day, one notification that says both is better than two that arrive at the same moment.

A queue with two caps

The queue holds at most 60 days with events within the next 400 days, whichever limit is hit first. The 60 stays a little under the system’s 64. The 400-day horizon keeps a sparse schedule from reaching years ahead.

A simplified version of the planning step looks like this:

func plan(_ occurrences: [Occurrence], from today: CivilDate) -> [DayNotification] {
    let horizon = today.adding(days: 400)
    let upcoming = occurrences.filter { $0.date >= today && $0.date < horizon }
    let byDay = Dictionary(grouping: upcoming, by: \.date)
    return byDay.keys.sorted().prefix(60).map { day in
        DayNotification(date: day, events: byDay[day]!)
    }
}

The planner is plain Swift with no UserNotifications import, so it is tested like any other function: give it occurrences and a date, check the days that come out.

How far the queue reaches depends on how busy the calendar is. Coverage is at most about 13 months:

  • Only the 1st and 15th: 27 notifications, about 13 months (the 400-day horizon cuts it).
  • Four monthly templates: 54 notifications, about 13 months.
  • Four templates plus a few memorial days with advance notice: all 60 slots, about a year.
  • Eight days a month: about 7 months.

Denser schedules cover less. That trade-off is fine as long as the queue is refilled before it runs dry.

Keeping the queue topped up

The queue is rebuilt from scratch whenever something could have changed it:

  • when the app becomes active,
  • when reminders, templates or settings change,
  • right after the user grants notification permission,
  • when the date or the time zone changes,
  • in a daily background refresh.

Data changes go through a debounced reschedule, so editing several reminders in a row triggers one rebuild, not ten.

Background refresh helps, but iOS decides whether it runs. It does not run in Low Power Mode or when Background App Refresh is off. So the app cannot promise that the queue refills on its own; opening the app now and then is what keeps reminders coming.

Telling the user where the queue ends

Because the queue has an end, Luminder says where it is. Settings shows “Scheduled through” followed by the date of the last queued notification. And the last notification in the queue carries one extra line: “Open Luminder to keep receiving reminders.” Someone who has not opened the app for a year gets a clear prompt instead of reminders that quietly stop.

One more detail: notification text uses the app language at the time it was scheduled. Changing the language in Settings rebuilds the queue, so pending notifications switch language too.

Takeaways

  • Group by day before counting. The limit is on notifications, not on reminders, so merging is the cheapest win.
  • Cap by count and by time. The count protects the system limit; the horizon keeps the queue meaningful.
  • Treat the queue as a cache. Rebuild it from the source data on every event that could change it, and do not try to patch it in place.
  • Be honest about the edge. A visible “Scheduled through” date and a last-notification nudge cost little and remove the worst failure, which is reminders silently stopping.

Written by Duy Pham Independent developer. I build the apps on this site and write about how they work.

More about me