Get Explore Feed
Retrieves the explore feed, which includes chatrooms and their details. This function allows users to fetch chatrooms based on specific criteria such as order type, pinned status, and pagination.
Steps to get explore feed
- Create a GetExploreFeedRequest object using
GetExploreFeedRequest.builder()
class by passing all the required parameters. - Call
getExploreFeed()
function using the instance ofLMChatClient
. - Process the response LMResponse<GetExploreFeedResponse> as per your requirement.
// object of GetExploreFeedRequest
let request = GetExploreFeedRequest.builder()
.orderType(1) // order type for the feed
.isPinned(true) // filter for pinned chatrooms
.page(1) // page number for pagination
.build()
LMChatClient.shared.getExploreFeed(request: request) { response in
// response (LMResponse<GetExploreFeedResponse>)
if let data = response.data {
// your function to process the response data
processExploreFeed(data)
} else if let error = response.error {
// your function to process error
handleError(error)
}
}
Models
GetExploreFeedRequest
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
orderType | Int | Specifies the order of the returned feed | |
isPinned | Bool | Filter for pinned chatrooms | ✔️ |
page | Int | Page number for pagination (default is 1) |
GetExploreFeedResponse
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
pinnedChatroomCount | Int | Number of pinned chatrooms | ✔️ |
exploreChatrooms | [Chatroom] | Array of converted Chatroom objects |