Skip to main content

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

  1. Use the markReadNotification() function provided by the lmFeedClient object created earlier.
  2. Create an instance of MarkReadNotificationRequest, as shown in the snippet and pass it to the above method.
  3. 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

VARIABLETYPEDESCRIPTIONOPTIONAL
activityIdstringID of the notification activity which is to be marked as read.