-1

How to schedule the notification based on the incremental time span

10 min, 10 hours, 20 hours, 1 day, 5 days, 1 week, 1 month, 5 month, 1 year, 5 years, 10 years.

Notification Message:
for 10 min
You have completed Successfully 10 min
for 10 hours
You have completed Successfully 10 hours
kiran
  • 4,285
  • 7
  • 53
  • 98
  • just schedule the first notification, then when it fires schedule the next notification and so on. – vivekDas Nov 21 '18 at 10:30
  • What are you actually trying to achieve, given question doesn't actually tell, a proper use case. Give more detail so better solutions can be suggested. – rptwsthi Nov 21 '18 at 11:07

1 Answers1

0

From the little information provided, I would proceed like the following :

  1. Look at NSUserDefaults to see what was the previous iteration
  2. Define a start time based on that previous iteration (if any)
  3. Schedule a local notification using the Local Notifications provided in the iOS SDK.
  4. Save that same date/time in the NSUserDefaults.
  5. Once we reach that time, the notification will be sent (by iOS), and we can execute code to repeat this sequence.
Gil Sand
  • 5,802
  • 5
  • 36
  • 78