Skip to main content

Post Conversation

LikeMinds React Native Chat SDK allows you to conveniently post a conversation in an existing chatroom by specifying the chatroom ID. This powerful feature enables you to contribute to ongoing discussions, share important information, or engage with other participants in real-time.

Steps to Post a Conversation

  1. To post a conversation, use the postConversation() method provided by the client you initialised.
  2. Pass in the required parameter.
  3. Process the response as per your requirement.
const payload: any = {
text: "ENTER_MESSAGE",
chatroomId: "ENTER_CHATROOM_ID",
hasFiles: false, // true if the conversation inclued attachments
};
const response = await lmChatClient?.postConversation(payload);

if (response.success) {
// your function to process the response data

// to update message locally
await myClient?.replaceSavedConversation(response?.conversation);
// your function to process the response data
processResponse(response);
} else {
// your function to process error message
processError(response);
}

Post Conversation Payload

List of parameters provided by postConversation()

VariableTypeDescriptionOptional
chatroomIdnumberChatroom Id
textstringText to be posted
hasFilesbooleanWhether the conversation has files
attachmentCountnumberNumber of attachments in the conversation✔️

Post Conversation Response

List of parameters in the response.

VariableTypeDescription
conversationConvesationConversation object