7

I'm trying to implement local notifications to my app. They will function as a reminder for an event, but the notifications must come from my app, and not from Calendar or Reminders.

My question is, how can I create notificaitons that fire before a certain date, while showing the actual date in the 'time-field'?

This is what the Calendar can do: calendar

Notice the top right corner saying "in 5m". I'm trying to get the same functionality for my own notifications, but I can't find anything about it. This is the only thing I can get: enter image description here
As soon as the notification arrives, it says "Now", and then proceeds to count up the amount of minutes ago. I need it to be sent X minutes before, and count down to "Now", then count up. Is this possible?

Ramy Al Zuhouri
  • 21,580
  • 26
  • 105
  • 187
Sti
  • 8,275
  • 9
  • 62
  • 124
  • 2
    Unfortunately it looks like this feature is exclusive to Apple's calendar app, likely through a private API. There doesn't seem to be an option for this within the UserNotifications framework, and other calendar apps such as Google Calendar do not have this functionality. – commscheck Jun 01 '17 at 06:19

1 Answers1

2

How about you create multiple custom Notification.Name like this posting.
You could have .onTime, .fiveMinutesReminder, .tenMinutesReminder, and so on.
The logic in your app would set when to fire those reminders. Your selector handler function would need to have some kind of switch statement to handler different reminder. The handler will need to show different text message based on the kind of the reminder.

Mikasa
  • 328
  • 2
  • 7