Skip to main content

View Participants

To retrieve the list of participants in a chatroom, LM React Native Chat SDK provides this feature. It enables you to retrieve user details, such as usernames or profile information, for better engagement and interaction within the chatroom.

Steps to Get the List of Participants in a Chatroom

  1. To fetch the list of the participants, use the method getParticipants provided by the client you initialised.
  2. Pass in the required parameters chatroomId, page, pageSize and isSecret.
  3. Process the response as per your requirement.
const payload: any = {
chatroomId: "ENTER_CHATROOM_ID",
isSecret: true, // true if the chatroom is secret
page: "ENTER_REQUIRED_PAGE_NO",
pageSize: "ENTER_PAGE_SIZE", /
};
const response = await lmChatClient?.getParticipants(payload);

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

View Participants Payload

List of parameters for the getParticipants method.

VariableTypeDescriptionOptional
chatroomIdnumberChatroom Id
pagenumberPage int
pageSizenumberPage size
isSecretbooleanIs secret chatroom
searchStringSearch string✔️

View Participants Response

List of parameters in the response.

VariableTypeDescription
participantsarrayList of participants
total_participants_countbooleanTotal participants Count