Mark notifications as read

How to use the notification API to mark some or all notifications as read


Mark A Specific Notification As Read #

Usage #

window.CordSDK.notification.markAsRead('my-awesome-notification-id');
Copy

What this function returns #

A promise which resolves when the database write has completed.

Arguments this function takes #


notificationID #

required
string
The ID of the notification to mark as read.

Mark All Notifications As Read #

Usage #

window.CordSDK.notification.markAllAsRead(
  { filter: { metadata: { flavor: 'minty' } } },
);
Copy

What this function returns #

A promise which resolves when the database writes have completed.

Arguments this function takes #


options #

optional
MarkAllNotificationsAsReadOptions
Miscellaneous options.

This is an object with the following fields:


filter
optional
NotificationListFilter
An object that can be used to filter the notifications marked as read.

This is an object with the following fields:


metadata
optional
EntityMetadata
An arbitrary JSON object specified when the notification is created. The value for a metadata entry should be an object representing the metadata key/value to filter on. For example, to show only notifications with the metadata key of "category" set to "sales", set the filter to { metadata: { category: "sales" } }.

location
optional
Location
The location where the notifications live. This will be the location of the thread containing the message which prompted the notification.

organizationID
optional
string
The organization to which the message that prompted the notification belongs.

Ask Cordy