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
- Get the list of participants using
getAllMember()
method. - Send Invite to selected members using
sendInvites()
method. - Pass the required parameters
chatroomId
,isSecret
andchatroomParticipants
. - 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.
Variable | Type | Description | Optional |
---|---|---|---|
chatroomId | number | Chatroom Id | |
isSecret | boolean | true if chatroom is secret | |
chatroomParticipants | array | List the IDs of participants |
Secret Chatroom Invite Response
List of parameters in the response.
Variable | Type | Description |
---|---|---|
success | boolean | API success status |
error_message | string | Error message in case of failure |