Skip to main content

Fetch Notification Feed

Notification feed is a great way to populate notifications for a user. You can achieve the same with LikeMinds SDK, by following the steps given below.

Steps to fetch notification feed

  1. Use the getNotificationFeed() function provided by the lmFeedClient object created earlier.
  2. Create an instance of GetNotificationFeedRequest, as shown in the snippet and pass it to the above method.
  3. Use the response as per your requirement
try {
const getNotificationFeedRequest = GetNotificationFeedRequest.builder()
.setPage(1) // page number for the paginated notification feed data
.setPageSize(10) // page number for the paginated notification feed data
.build();
const response = await lmFeedClient.getNotificationFeed(
getNotificationFeedRequest
);
// Use the response as per your requirement.
} catch (error) {
// Use the error as per your requirement.
}

Models

GetNotificationFeedRequest

VARIABLETYPEDESCRIPTIONOPTIONAL
pageintPage number for paginated notification feed data.
pageSizeintPage size for paginated notification feed data.

GetNotificationFeedResponse

VARIABLETYPEDESCRIPTIONOPTIONAL
activitiesActivityList of activities inside notification feed.
usersRecord<string, User>Dictionary of UUID to user object.
topicsRecord<string, Topic >Map of topic id to topic object.
widgetsRecord<string, Widget>Map of widgets.✔️