Skip to main content

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

  1. Create a GetExploreFeedRequest object using GetExploreFeedRequest.builder() class by passing all the required parameters.
  2. Call getExploreFeed() function using the instance of LMChatClient.
  3. 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

VARIABLETYPEDESCRIPTIONOPTIONAL
orderTypeIntSpecifies the order of the returned feed
isPinnedBoolFilter for pinned chatrooms✔️
pageIntPage number for pagination (default is 1)

GetExploreFeedResponse

VARIABLETYPEDESCRIPTIONOPTIONAL
pinnedChatroomCountIntNumber of pinned chatrooms✔️
exploreChatrooms[Chatroom]Array of converted Chatroom objects