Notification reminders

In Notifications v1.22 or later, users can set reminders on notifications. This feature lets them dismiss the notification temporarily, until the reminder time occurs. You can disable this feature, and not allow users to set a reminder on a notification. You can also add a reminder time when you create the notification.

How it works

You can configure the following properties when you define the notification:

  • reminderDate (optional): the Date object that represents the reminder time
  • allowReminder (boolean, default true): set to false to disable reminders

You cannot set a reminder time if you disable reminders. Such a combination throws an error.

How to do it

const exampleNotification: BaseNotificationOptions = 
{
  
  // rest of your notification definition

  // optional if you want to set the reminder time yourself
  // otherwise users can set it
  // throws an error if `allowReminder` is set to `false`
  reminderDate: DATE_OBJECT_FOR_REMINDER
  
  // or, to keep users from setting a reminder. Default value is `true`.
  // value `false` throws an error if `reminderDate` is set
  allowReminder: false  
};
 
 create(exampleNotification);