Skip to main content

Get Personalised Feed

The LikeMinds Android Feed SDK provides a powerful Personalised Feed feature for your Android app. Easily integrate a versatile feed that allows all the users in the community to view a user-ranked feed.

Steps to get Personalised feed

  1. Create a GetPersonalisedFeedRequest object using GetPersonalisedFeedRequest.Builder class by passing all the required parameters.
  2. Call getPersonalisedFeed() function using the instance of LMFeedClient.
  3. Process the response LMResponse<GetPersonalisedFeedResponse> as per your requirement.
CoroutineScope(Dispatchers.IO).launch {
// object of GetPersonalisedFeedRequest
val getPersonalisedFeedRequest = GetPersonalisedFeedRequest.Builder()
.page(1) // page number for paginated feed data
.pageSize(10) // page size for paginated feed data
.build()
// get response (LMResponse<GetPersonalisedFeedResponse>)
val response = LMFeedClient.getInstance().getPersonalisedFeed(getPersonalisedFeedRequest)
if (response.success) {
// your function to process the response data
processGetPersonalisedFeedResponse(response.data)
} else {
// your function to process error message
processError(response.errorMessage)
}
}

Models

GetPersonalisedFeedRequest

VARIABLETYPEDESCRIPTIONOPTIONAL
pageIntPage number for paginated feed data.
pageSizeIntPage size for paginated feed data.
shouldRecomputeBooleanWhether the feed should be recomuted✔️
shouldReorderBooleanwhether the feed should be reordered✔️

GetPersonalisedFeedResponse

VARIABLETYPEDESCRIPTIONOPTIONAL
postsList<Post>List of posts inside feed.
usersMap<String, User>Map of user unique id to user object.
topicsMap<String, Topic>Map of topic id to topic object.
widgetsMap<String, Widget>Map of widget id to widget object.
filteredCommentsMap<String, Comment>Map of comment id to comment object✔️