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
- Create an object of the
FollowChatroomRequest
class. - Call the
followChatroom()
function using the instance of theLMChatClient
class. - 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
Variable | Type | Description | Optional |
---|---|---|---|
chatroomId | int | Unique ID of the chatroom | |
memberId | int? | Unique ID of the member | ✔️ |
value | bool | Set to true to follow, false to unfollow |