Skip to main content

Join Chatroom

Joining a chatroom with LikeMinds Flutter Chat SDK allows you to receive timely notifications for all conversations happening within that chatroom.Experience real-time engagement and never miss out on any important conversations by joining the chatroom using LikeMinds Flutter Chat SDK.

Steps to Join an Open Chatroom​

  1. Create an object of the FollowChatroomRequest class.
  2. Call the followChatroom() function using the instance of the LMChatClient class.
  3. Process the response LMResponse<void> as per your requirement.
// To leave a chatroom, set the value to false
FollowChatroomRequest request = (FollowChatroomRequestBuilder()
..chatroomId("ENTER_CHATROOM_ID")
..memberId("ENTER_MEMBER_ID")
..value(true)) //Set to false in case of leave
.build();

LMResponse<void> response = await lmChatClient.followChatroom(request);

if (response.success) {
// your function to handle successful follow action
handleFollowSuccess();
} else {
// your function to handle follow error
handleFollowError(response.errorMessage);
}

Models​

FollowChatroomRequest​

List of parameters for the FollowChatroomRequest class

VariableTypeDescriptionOptional
chatroomIdintUnique ID of the chatroom
memberIdint?Unique ID of the member✔️
valueboolSet to true to follow, false to unfollow