Skip to main content

Secret Chatroom Invite

LikeMinds React Native Chat SDK offers a convenient feature for sending secret chatroom invites. It allows you to send invites to a specific user within a group chat.

Steps to send Secret Chatroom Invite to a participant

  1. Get the list of participants using getAllMember() method.
  2. Send Invite to selected members using sendInvites() method.
  3. Pass the required parameters chatroomId, isSecret and chatroomParticipants.
  4. Process the response as per your requirement.
const payload: any = {
page: 1, // The required page no.
};
const response = await myClient?.getAllMembers(payload);

if (response.success) {
// your function to process the response data
processResponse();
} else {
// your function to process error message
processError(response);
}
const payload: any = {
chatroomId: 89899, // your chatroom id
isSecret: true,
chatroomParticipants: [343566, 457868], // list the IDs of participants who have been selected.
};
const response = await myClient?.sendInvites(payload);

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

Secret Chatroom Invite Payload

List of parameters for the sendInvites() function.

VariableTypeDescriptionOptional
chatroomIdnumberChatroom Id
isSecretbooleantrue if chatroom is secret
chatroomParticipantsarrayList the IDs of participants

Secret Chatroom Invite Response

List of parameters in the response.

VariableTypeDescription
successbooleanAPI success status
error_messagestringError message in case of failure