Get Conversations
Simplify your chat application development with LikeMinds React Native Chat SDK. Enhance user conversations, enable real-time messaging, and provide seamless communication experiences with minimal coding effort. By utilizing this feature you can view all the conversations in the chatroom.
Steps to fetch Conversations inside a Chatroom
- Call
getConversations()
function using the instance of lmChatClient. - Process the response as per your requirement.
const getConversationsRequest = GetConversationsRequestBuilder.builder()
.setChatroomId("ENTER_CHATROOM_ID")
.setLimit("ENTER_PAGE_SIZE")
.build();
const repsonse = lmChatClient?.getConversations(getConversationsRequest);
if (response.success) {
// your function to process the response data
processResponse(response);
} else {
// your function to process error message
processError(response);
}
GetConversationsRequest
Variable | Type | Description | Optional |
---|---|---|---|
chatroomId | string | ID of the chatroom | |
limit | number | Maximum number of conversations to fetch | |
medianConversation | Conversation | Median conversation for pagination | ✔️ |
type | GetConversationsType | Enum containing type of conversation to retrieve | ✔️ |
GetConversationsType
Enum Value | Description |
---|---|
ALL | Fetches all conversations |
ABOVE | Fetches conversations above the median conversation |
BELOW | Fetches conversations below the median conversation |