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
- Create a GetPersonalisedFeedRequest object using
GetPersonalisedFeedRequest.Builder
class by passing all the required parameters. - Call
getPersonalisedFeed()
function using the instance ofLMFeedClient
. - 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
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
page | Int | Page number for paginated feed data. | |
pageSize | Int | Page size for paginated feed data. | |
shouldRecompute | Boolean | Whether the feed should be recomuted | ✔️ |
shouldReorder | Boolean | whether the feed should be reordered | ✔️ |
GetPersonalisedFeedResponse
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
posts | List<Post> | List of posts inside feed. | |
users | Map<String, User> | Map of user unique id to user object. | |
topics | Map<String, Topic> | Map of topic id to topic object. | |
widgets | Map<String, Widget> | Map of widget id to widget object. | |
filteredComments | Map<String, Comment> | Map of comment id to comment object | ✔️ |