Skip to main content

Get Conversation

LikeMinds React Native Chat SDK offers this feature which enables you to access and analyze individual conversations, empowering you to implement customized functionalities or perform specific operations within your chat application.

Steps to Get a Single Conversation

  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("ENTER_CHATROOM_ID")
.setPage("ENTER_REQURIED_PAGE_NO")
.setMinTimestamp("ENTER_MIN_TIMESTAMP")
.setMaxTimestamp(Date.now())
.setPageSize("ENTER_PAGE_SIZE")
.setConversationId("ENTER_CONVERSATION_ID")
.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

| userMeta | Member | User data | | | conversationMeta | Conversation | Conversation data | | | conversationData | Conversation[] | List of conversations | | | communityMeta | Community | Community data | | | chatroomsMeta | Chatroom | Chatroom data | | | chatroomReactionsMeta | ReactionMeta[] | List of reactions | | | convReactionsMeta | ReactionMeta[] | List of reactions | | | convAttachmentsMeta | Attachment[] | List of attachments | | | convPollsMeta | Poll[] | List of Polls | |