Skip to main content

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

  1. Create a syncConversationRequest object using SyncConversationRequest.builder class by passing all the required parameters.
  2. Call syncConversation() function using the instance of lmChatClient.
  3. Process the response LMResponse<SyncConversationResponse> as per your requirement.
const syncConversationRequest = SyncConversationRequest.builder()
.setChatroomId(86490)
.setPage(1)
.setMinTimestamp(0)
.setMaxTimestamp(Date.now())
.setPageSize(500)
.build();
const repsonse = lmChatClient?.syncConversation(syncConversationRequest);

if (response.success) {
// your function to process the response data
processResponse(response);
} else {
// your function to process error message
processError(response);
}

Sync Conversation Payload

List of parameters provided by syncConversation().

VariableTypeDescriptionOptional
chatroomIdnumberchatroom Id
conversationIdnumber?conversation id for which you want to get the conversation✔️
pagenumberpage number
pageSizenumberpage size for paginated response
maxTimestampnumbermaximum timestamp
minTimestampnumberminimum timestamp

Sync Conversation Response

List of parameters in the response.

VariableTypeDescriptionOptional
successbooleanAPI success status
error_messagestringError message in case of failure✔️
userMetaMemberUser data
conversationMetaConversationConversation data
conversationDataConversation[]List of conversations
communityMetaCommunityCommunity data
chatroomsMetaChatroomChatroom data
chatroomReactionsMetaReactionMeta[]List of reactions
convReactionsMetaReactionMeta[]List of reactions
convAttachmentsMetaAttachment[]List of attachments
convPollsMetaPoll[]List of Polls