1

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?

faircloud
  • 687
  • 6
  • 14
  • Why not set it up so that your initial notification does not repeat, and it creates a new, repeating notification that uses the permanent trigger interval? – creeperspeak Mar 03 '17 at 00:34
  • 1
    How would I have the the initial notification create the permanent trigger interval? As far aw I am aware there is nowhere for me to handle a response to the notification triggering. I can respond to a a user tapping on the notification, but if they ignore it I have no way to create the permanent notification. – faircloud Mar 03 '17 at 00:39
  • Schedule your first notification with the time interval after it's fires, schedule another one with permanent time interval with the same identifier – Mannopson Mar 03 '17 at 01:10
  • @Mannopson as far as I'm aware we have no way to capture the event when when the first notification fires unless the user interacts with the notification in some way, correct? – faircloud Mar 03 '17 at 05:58
  • @faircloud Yes! You're right. But with the user interaction you can do something like that. – Mannopson Mar 03 '17 at 06:12

0 Answers0