Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I create reminder/alert-type notifications from my own app?

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?

like image 397
Sti Avatar asked May 24 '17 11:05

Sti


1 Answers

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.

like image 118
Mikasa Avatar answered Sep 22 '22 12:09

Mikasa