Triggering UNUserNotification Trigger with Changing Repeat Interval

439 Views Asked by At

I've gone through all of Apple's Documentation on the new User Notification framework and I am officially stumped.

I need to set up a UNNotificationRequest to trigger after X days. This can be easily accomplished with the UNTimeIntervalNotificationTrigger. However, the problem is that I need this notification to then repeat every Y days. Where Y is not necessarily equal to X.

I originally thought I could simply schedule a second UNNotificationRequest that repeats on a time interval of Y, but then it would either fire before that first X date is passed or it would not fire on the correct intervals.

For example, if I schedule a notification for 3 days from now and then want that notification to repeat every day after it fires, how would I do this without setting up my own scheduling system to wake the app up in the background and check if the it is time to schedule a second UNNotificationRequest?

0

There are 0 best solutions below