Scheduling Local Notifications with custom repeat interval

I am building an application where I need to implement a use case where a local notification is set for a specific date / time (e.g 11/4/16 8 PM) to display to the user (e.g. "Take your medicene") and I want him to continue to get that alert every X minutes (e.g. every 5 minutes) until I cancel it (e.g. when the user indicates he has taken his medicene).


NOTE: I do NOT want to rely on push notifications from the server for doing the reminders because it needs to work when the device is off the network (like on a plane or a cruise ship in the middle of the ocean or whatever).


This would seem to be a pretty common use case, but looking at the previous and existing local notification frameworks, I only see the option to create a calendar based trigger with a boolean repeat (UNCalendarNotificationTrigger) or a time interval based trigger with a boolean repeat (UnTimeIntervalNotificationTrigger), but nothing that combines these in a way that allows me to implement the above stated use case.


Am I missing something obvious here? I am pretty much a newbie iOS / Swift guy so please be gentle as I have spent many hours searching for a solution both here, stackoverflow, etc. before posting this.


If there really is not a way to do this with the core iOS API / SDK, whats the best practice for implementing something like this?? Scheduing a series of notifications without the repeat seemed like an option until I found out about the 64 notification limit.


Any help is SO much appreciated!


Thanks,


Rich

Theoretically, this can work:

Use BGTaskScheduler to set up notifications. You will be required to do some calculations to find when to trigger the background task.

For example, you want to trigger the notification the first notification at 14:00 and post that, every 5 minutes until notification is dismissed. You will schedule the background task for 13:55 and inside the background task set up the repeating notification with the time interval of 5 minutes.

Hope this helps.

Scheduling Local Notifications with custom repeat interval
 
 
Q