2

I need to set up UI Local Notification once a day for 21 days in row, after 21 days I need these notifications to pause for 7 days and then start again.

Im developing a Swift 2.3 application for woman menstrual period control and I need to create pill reminder that has to be for each 21 days, wait 7 days then 21 days of continuous reminder (per day).

I know that I can schedule using interval but how to do these "breaks" between the 21 continuous reminders?

Renaro Santos
  • 403
  • 1
  • 7
  • 19

1 Answers1

0

Consider invalidating your first reminder at 21st day and adding second one with different action(It should start reminder of first type).

Here is the logic:

You start your reminder which repeats every day. On 21st action you invalidate your reminder and start a new one, which waits 7 days and fires. You start your reminder which repeats every day. ...

George Sabanov
  • 179
  • 1
  • 8
  • The logic I already prepared, but I dont know how to fire the event to cancel and re-schecule into the 21st day, how can I listen the 21st notification and execute something? – Bruno Pantaleão Nov 10 '16 at 17:05
  • well I am not sure that this is the best solution, but first thought is to store progress in UserDefaults. Like you store there your day number and when it is 21 you can reset it's value. Maybe there is something like userInfo and you can send your value there – George Sabanov Nov 10 '16 at 18:43
  • The hole logic I have probably coded, I just need to know someway to listen when the 21st notification will be launched to schedule the next 21 notifications after 7 days – Bruno Pantaleão Nov 10 '16 at 20:48