Mark Notification Read
You can use the following function from the LikeMinds SDK to mark the notifications that have been clicked by user in your application, as read.
Steps to mark a notification as read
- Use the
markReadNotification()function provided by thelmFeedClientobject created earlier. - Create an instance of
MarkReadNotificationRequest, as shown in the snippet and pass it to the above method. - Use the response as per your requirement
try {
const markReadNotificationRequest = MarkReadNotificationRequest.builder()
.setActivityId("<ENTER_ACTIVITY_ID>")
.build();
const response = await lmFeedClient.markReadNotification(
markReadNotificationRequest
);
// Use the response as per your requirement.
} catch (error) {
// Use the error as per your requirement.
}
MarkReadNotificationRequest
| VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
|---|---|---|---|
activityId | string | ID of the notification activity which is to be marked as read. |