# Manage chat group members (/en/realtime-media/im/build/build-groups-rooms-and-threads/chat-group/manage-group-members)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

<_PlatformTabsGroup groupMode="structured" canonicalPlatform="web" platforms="[&#x22;android&#x22;,&#x22;ios&#x22;,&#x22;flutter&#x22;,&#x22;react-native&#x22;,&#x22;windows&#x22;,&#x22;unity&#x22;,&#x22;web&#x22;]" showTabs="true">
  <_PlatformPanel platform="android">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="android" />

    Chat groups enable real-time messaging among multiple users.

    This page shows how to use the Chat SDK to manage the members of a chat group in your app.

    ## Understand the tech [#understand-the-tech]

    The Chat SDK provides the `Group`, `GroupManager`, and `GroupChangeListener` classes for chat group management, which allows you to implement the following features:

    ## Prerequisites [#prerequisites]

    Before proceeding, ensure that you meet the following requirements:

    * You have initialized the Chat SDK. For details, see [SDK quickstart](../../../get-started-sdk).
    * You understand the call frequency limits of the Chat APIs supported by different pricing plans as described in [Limitations](../../limitations).
    * You understand the number of chat groups and chat group members supported by different pricing plans as described in [Pricing Plan Details](../../../reference/pricing-plan-details).

    ## Implementation [#implementation]

    This section describes how to call the APIs provided by the Chat SDK to implement chat group features.

    ### Manage chat group members [#manage-chat-group-members]

    1. Add users to a chat group.
       Whether a chat group is public or private, the chat group owner and chat group admins can add users to the chat group. As for private groups, if the type of a chat group is set to `GroupStylePrivateMemberCanInvite`, group members can invite users to join the chat group.

    2. Implement chat group invitations.

       Does a group invitation require consent from an invitee to add them to the group (`inviteNeedConfirm`):

       * Yes (`option.InviteNeedConfirm` is set to`true`). After creating a group and sending group invitations, the subsequent logic varies based on whether an invitee automatically consents to the group invitation (`autoAcceptGroupInvitation`):
         * Yes (`autoAcceptGroupInvitation` is set to `true`). The invitee automatically joins the chat group and receives the `GroupChangeListener#onAutoAcceptInvitationFromGroup` callback, the inviter receives the `GroupChangeListener#onInvitationAccepted` and `GroupChangeListener#onMembersJoined` callbacks, and the other chat group members receive the `GroupChangeListener#onMembersJoined` callback.
         * No (`autoAcceptGroupInvitation` is set to `false`). The invitee receives the GroupChangeListener#onInvitationReceived callback and chooses whether to join the chat group:
           * If the invitee accepts the group invitation, the inviter receives the `GroupChangeListener#onInvitationAccepted` and `GroupChangeListener#onMembersJoined` callbacks and the other chat group members receive the `GroupChangeListener#onMembersJoined` callback;
           * If the invitee declines the group invitation, the chat group owner receives the `GroupChangeListener#groupInvitationDidDecline` callback.

       * No (`option.InviteNeedConfirm` is set to `false`). After creating a chat group and sending group invitations, an invitee is added to the chat group regardless of their `autoAcceptGroupInvitation` setting. The invitee receives the `GroupChangeListener#onAutoAcceptInvitationFromGroup` callback, the inviter receives the `GroupChangeListener#onInvitationAccepted` and `GroupChangeListener#onMembersJoined` callbacks and the other chat group members receive the `GroupChangeListener#onMembersJoined` callback.

    3. Remove chat group members from a chat group.
       The chat group owner and chat group admins can remove chat group members from a chat group, whereas chat group members do not have this privilege. Once a group member is removed, the removed member receives the `onUserRemoved` callback and all other members in the group receive the `onMembersExited` callback.

    Refer to the following sample code to add and remove a user:

    ```java
    // The chat group owner and chat group admins can call addUsersToGroup to add users to a chat group.
    ChatClient.getInstance().groupManager().addUsersToGroup(groupId, newmembers);

    // Chat group members can call inviteUser to invite users to a chat group.
    ChatClient.getInstance().groupManager().inviteUser(groupId, newmembers, null);

    // The chat group owner and chat group admins can call removeUserFromGroup to remove a member from a chat group.
    ChatClient.getInstance().groupManager().removeUserFromGroup(groupId, username);
    // The chat group owner and chat group admins can call asyncRemoveUsersFromGroup to remove members from a chat group.
    ChatClient.getInstance().groupManager().asyncRemoveUsersFromGroup("GroupId", userList, new CallBack() {
                @Override
                public void onSuccess() {

                }

                @Override
                public void onError(int code, String error) {

                }
            });
    ```

    ### Manage chat group ownership and admin [#manage-chat-group-ownership-and-admin]

    1. Transfer the chat group ownership.
       The chat group owner can transfer ownership to the specified chat group member. Once ownership is transferred, the original chat group owner becomes a group member. The new owner receives the `onOwnerChanged` callback.

    2. Add chat group admins.
       The chat group owner can add admins. Once added to the chat group admin list, the newly added admin and the other chat group admins receive the `onAdminAdded` callback.

    3. Remove chat group admins.
       The chat group owner can remove admins. Once removed from the chat group admin list, the removed admin and the other chat group admins receive the `onAdminRemoved` callback.

    Refer to the following sample code the manage chat group ownership and admin:

    ```java
    // The chat group owner can call changeOwner to transfer ownership to the specified chat group member.
    ChatClient.getInstance().groupManager().changeOwner(groupId, newOwner);

    // The chat group owner can call `addGroupAdmin` to add admins.
    ChatClient.getInstance().groupManager().addGroupAdmin(groupId, admin);

    // The chat group owner can call `removeGroupAdmin` to remove admins.
    ChatClient.getInstance().groupManager().removeGroupAdmin(groupId, admin);
    ```

    ### Manage the chat group blocklist [#manage-the-chat-group-blocklist]

    The chat group owner and chat group admins can add or remove the specified member to the chat group blocklist. Once a chat group member is added to the blocklist, this member cannot send or receive chat group messages, nor can this member join the chat group again.

    Refer to the following sample code to manage the chat group blocklist:

    ```java
    // The chat group owner and admins can call blockUser to add the specified member to the chat group blocklist.
    ChatClient.getInstance().groupManager().blockUser(groupId, username);

    // The chat group owner and admins can call unblockUser to remove the specified member from the chat group blocklist.
    ChatClient.getInstance().groupManager().unblockUser(groupId, username);

    // The chat group owner and admins can call getBlockedUsers to retrieve the chat group blocklist.
    ChatClient.getInstance().groupManager().getBlockedUsers(groupId);
    ```

    ### Manage the chat group mute list [#manage-the-chat-group-mute-list]

    The chat group owner and chat group admins can add or remove the specified member to the chat group mute list. Once a chat group member is added to the mute list, this member can no longer send chat group messages, not even after being added to the chat group allow list.

    Refer to the following sample code to manage the chat group mute list:

    ```java
    // The chat group owner and admins can call muteGroupMember to add the specified member to the chat group mute list. The muted member and all the other chat group admins or owner receive the onMuteListAdded callback.
    // duration: The mute duration. If you pass `-1`, members are muted permanently.
    ChatClient.getInstance().groupManager().muteGroupMembers(groupId, muteMembers, duration);

    // The chat group owner and admins can call unmuteGroupMember to remove the specified user from the chat group mute list. The unmuted member and all the other chat group admins or owner receive the onMuteListRemoved callback.
    ChatClient.getInstance().groupManager().unMuteGroupMembers(String groupId, List members);

    // The chat group owner or admin can call fetchGroupMuteList to retrieve the chat group mute list.
    ChatClient.getInstance().groupManager().fetchGroupMuteList(String groupId, int pageNum, int pageSize);
    ```

    ### Mute and unmute all the chat group members [#mute-and-unmute-all-the-chat-group-members]

    The chat group owner and chat group admins can mute or unmute all the chat group members. Once all the members are muted, only those in the chat group allow list can send messages in the chat group.

    Unlike muting a chat group member, this kind of mute does not expire automatically after a certain period and you need to call the `unmuteAllMembers` method to unmute all members in the chat group.

    Refer to the following sample code to mute and unmute all the chat group members:

    ```java
    // The chat group owner or admin can call muteAllMembers to mute all the chat group members. Once all the members are muted, these members receive the onAllMemberMuteStateChanged callback.
    public void muteAllMembers(final String groupId, final ValueCallBack callBack);

    // The chat group owner or admin can call unmuteAllMembers to unmute all the chat group members. Once all the members are unmuted, these members receive the onAllMemberMuteStateChanged callback.
    public void unmuteAllMembers(final String groupId, final ValueCallBack callBack);
    ```

    ### Manage the chat group allow list [#manage-the-chat-group-allow-list]

    The chat group owner and admins are added to the chat group allow list by default.

    Members in the chat group allow list can send chat group messages even when the chat group owner or admin has muted all chat group members. However, if a member is already in the chat group mute list, this member still cannot send messages in the group even after being added to the group allow list.

    Refer to the following sample code to manage the chat group allow list:

    ```java
    // The chat group owner or admin can call addToChatGroupWhiteList to add the specified member to the chat group allow list. Once the member is added, all the other chat group admins or owner receive the onWhiteListAdded callback.
    public void addToGroupWhiteList(final String groupId, final List members, final CallBack callBack);

    // The chat group owner or admin can call removeFromChatGroupWhiteList to remove the specified member from the chat group list. Once the member is removed, all the other chat group admins or owner receive the onWhiteListRemoved callback.
    public void removeFromGroupWhiteList(final String groupId, final List members, final CallBack callBack);

    // Chat group members can call checkIfInChatGroupWhiteList to check whether they are in the chat group allow list.
    public void checkIfInGroupWhiteList(final String groupId, ValueCallBack callBack);

    // The chat group owner or admin can call fetchChatGroupWhiteList to retrieve the chat group allow list.
    public void fetchGroupWhiteList(final String groupId, final ValueCallBack> callBack);
    ```

    ### Listen for chat group events [#listen-for-chat-group-events]

    For details, see [Chat Group Events](./manage-chat-groups#listen-for-chat-group-events).

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>

  <_PlatformPanel platform="ios">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="ios" />

    Chat groups enable real-time messaging among multiple users.

    This page shows how to use the Chat SDK to manage the members of a chat group in your app.

    ## Understand the tech [#understand-the-tech-1]

    The Chat SDK provides the `IAgoraChatGroupManager`, `AgoraChatGroupManagerDelegate`, and `AgoraChatGroup` classes for chat group management, which allows you to implement the following features:

    ## Prerequisites [#prerequisites-1]

    Before proceeding, ensure that you meet the following requirements:

    * You have initialized the Chat SDK. For details, see [SDK quickstart](../../../get-started-sdk).
    * You understand the call frequency limits of the Chat APIs supported by different pricing plans as described in [Limitations](../../limitations).
    * You understand the number of chat groups and chat group members supported by different pricing plans as described in [Pricing Plan Details](../../../reference/pricing-plan-details).

    ## Implementation [#implementation-1]

    This section describes how to call the APIs provided by the Chat SDK to implement chat group features.

    ### Manage chat group members [#manage-chat-group-members-1]

    1. Add users to a chat group.
       Whether a chat group is public or private, the chat group owner and chat group admins can add users to the chat group. As for private groups, if the type of a chat group is set to `AgoraChatGroupStylePrivateMemberCanInvite`, group members can invite users to join the chat group.

    2. Implement chat group invitations.
       After a user is invited to join a chat group, the implementation logic varies based on the settings of the user:
       * If the user requires a group invitation confirmation, the inviter receives the `groupInvitationDidReceive` callback. Once the user accepts the request and joins the group, the user receives the `groupInvitationDidAccept` callback and all group members receive the `userDidJoinGroup` callback. Otherwise, the user receives the `groupInvitationDidDecline` callback.
       * If the user does not require a group invitation confirmation, the user receives the `groupInvitationDidAccept` callback. In this case, the user automatically accepts the group invitation and receives the `didJoinGroup` callback. All group members receive the `userDidJoinGroup` callback.

    3. Remove chat group members from a chat group.
       The chat group owner and chat group admins can remove chat group members from a chat group, whereas chat group members do not have this privilege. Once a group member is removed, the group member receives the `didLeaveGroup` callback and all the other group members receive the `userDidLeaveGroup` callback.

    Refer to the following sample code to add and remove a user:

    ```objc
    // Group members can call addMembers to add users to a chat group.
    [[AgoraChatClient sharedClient].groupManager addMembers:@{@"member1",@"member2"}
    toGroup:@"groupID"
    message:@"message"
    completion:nil];

    // The chat group owner and chat group admins can call removeMembers to remove group members from a chat group.
    [[AgoraChatClient sharedClient].groupManager removeMembers:@{@"member"}
    fromGroup:@"groupsID"
    completion:nil];
    ```

    ### Manage chat group ownership and admin [#manage-chat-group-ownership-and-admin-1]

    1. Transfer the chat group ownership.
       The chat group owner can transfer ownership to the specified chat group member. Once ownership is transferred, the original chat group owner becomes a group member. The new owner receives the `groupOwnerDidUpdate` callback.

    2. Add chat group admins.
       The chat group owner can add admins. Once added to the chat group admin list, the newly added admin and the other chat group admins receive the `groupAdminListDidUpdate` callback.

    3. Remove chat group admins.
       The chat group owner can remove admins. Once removed from the chat group admin list, the removed admin and the other chat group admins receive the `groupAdminListDidUpdate` callback.

    Refer to the following sample code to manage chat group ownership and admin:

    ```objc
    // The chat group owner can call updateGroupOwner to transfer ownership to the specified chat group member.
    [[AgoraChatClient sharedClient].groupManager updateGroupOwner:@"groupID"
                                                         newOwner:@"newOwner"
                                                             error:nil];

    // The chat group owner can call addAdmin to add admins.
    [[AgoraChatClient sharedClient].groupManager addAdmin:@"member"
                                                   toGroup:@"groupID"
                                                     error:nil];

    // The chat group owner can call removeAdmin to remove admins.
    [[AgoraChatClient sharedClient].groupManager removeAdmin:@"admin"
                                                    fromGroup:@"groupID"
                                                        error:nil];
    ```

    ### Manage the chat group blocklist [#manage-the-chat-group-blocklist-1]

    The chat group owner and chat group admins can add or remove the specified member to the chat group blocklist. Once a chat group member is added to the blocklist, this member cannot send or receive chat group messages, nor can this member join the chat group again.

    Refer to the following sample code to manage the chat group blocklist:

    ```objc
    // The chat group owner and admins can call blockMembers to add the specified member to the chat group blocklist.
    [[AgoraChatClient sharedClient].groupManager blockMembers:members
                                                     fromGroup:@"groupID"
                                                    completion:nil];

    // The chat group owner and admins can call unblockMembers to remove the specified member from the chat group blocklist.
    [[AgoraChatClient sharedClient].groupManager unblockMembers:members
                                                          fromGroup:@"groupId"
                                                         completion:nil];

    // The chat group owner and admins can call getGroupBlacklistFromServerWithId to retrieve the chat group blocklist.
    [[AgoraChatClient sharedClient].groupManager getGroupBlacklistFromServerWithId:@"groupId"
                            pageNumber:pageNumber
                              pageSize:pageSize
                            completion:nil];
    ```

    ### Manage the chat group mute list [#manage-the-chat-group-mute-list-1]

    The chat group owner and chat group admins can add or remove the specified member to the chat group mute list. Once a chat group member is added to the mute list, this member can no longer send chat group messages, not even after being added to the chat group allow list.

    Refer to the following sample code to manage the chat group mute list:

    ```objc
    // The chat group owner and admins can call muteMembers to add the specified member to the chat group mute list.
    // The muted member and all the other chat group admins or owner receive the groupMuteListDidUpdate callback.
    // muteMilliseconds: The mute duration. If you pass `-1`, members are muted permanently.
    [[AgoraChatClient sharedClient].groupManager muteMembers:members
                                             muteMilliseconds:60
                                                    fromGroup:@"groupID"
                                                        error:nil];

    // The chat group owner and admins can call unmuteMembers to remove the specified user from the chat group mute list.
    // The unmuted member and all the other chat group admins or owner receive the groupMuteListDidUpdate callback.
    [[AgoraChatClient sharedClient].groupManager unmuteMembers:members
                                                      fromGroup:@"groupID"
                                                          error:nil];

    // The chat group owner or admin can call getGroupMuteListFromServerWithId to retrieve the chat group mute list.
    [[AgoraChatClient sharedClient].groupManager getGroupMuteListFromServerWithId:@"groupID"
                                                                        pageNumber:pageNumber
                                                                         pageSize:pageSize
                                                                            error:nil];
    ```

    ### Mute and unmute all the chat group members [#mute-and-unmute-all-the-chat-group-members-1]

    The chat group owner and chat group admins can mute or unmute all the chat group members. Once all the members are muted, only those in the chat group allow list can send messages in the chat group. Once a chat group member is added to the chat group mute list, the member can no longer send chat group messages, not even after being added to the chat group allow list.

    As the mute does not expire in a certain period, you need to call the API of unmuting all chat group members to stop muting them.

    Refer to the following sample code to mute and unmute all the chat group members:

    ```objc
    // The chat group owner or admin can call muteAllMembersFromGroup to mute all the chat group members.
    // Once all the members are muted, these members receive the groupAllMemberMuteChanged callback.
    [[AgoraChatClient sharedClient].groupManager muteAllMembersFromGroup:@"groupID"
                                                                    error:nil];

    // The chat group owner or admin can call unmuteAllMembersFromGroup to unmute all the chat group members.
    // Once all the members are unmuted, these members receive the groupAllMemberMuteChanged callback.
    [[AgoraChatClient sharedClient].groupManager unmuteAllMembersFromGroup:@"groupID"
                                                                      error:nil];
    ```

    ### Manage the chat group allow list [#manage-the-chat-group-allow-list-1]

    The chat group owner and admins are added to the chat group allow list by default.

    Members in the chat group allow list can send chat group messages even when the chat group owner or admin has muted all chat group members. However, if a member is already in the chat group mute list, this member still cannot send messages in the group even after being added to the allow list.

    Refer to the following sample code to manage the chat group allow list:

    ```objc
    // The chat group owner or admin can call addWhiteListMembers to add the specified member to the chat group allow list.
    // Once the member is added, all the other chat group admins or owner receive the groupWhiteListDidUpdate callback.
    [[AgoraChatClient sharedClient].groupManager addWhiteListMembers:members
                                                            fromGroup:@"groupID"
                                                                error:nil];

    // The chat group owner or admin can call removeWhiteListMembers to remove the specified member from the chat group list.
    // Once the member is removed, all the other chat group admins or owner receive the groupWhiteListDidUpdate callback.
    [[AgoraChatClient sharedClient].groupManager removeWhiteListMembers:members
                                                               fromGroup:@"groupID"
                                                                   error:nil];

    // Chat group members can call isMemberInWhiteListFromServerWithGroupId to check whether they are in the chat group allow list.
    [[AgoraChatClient sharedClient].groupManager
                                     isMemberInWhiteListFromServerWithGroupId:@"groupID"
                                                                       error:nil];

    // The chat group owner or admin can call getGroupWhiteListFromServerWithId to retrieve the chat group allow list.
    [[AgoraChatClient sharedClient].groupManager getGroupWhiteListFromServerWithId:@"groupID"                                                                          error:nil];
    ```

    ### Listen for chat group events [#listen-for-chat-group-events-1]

    For details, see [Chat Group Events](./manage-chat-groups#listen-for-chat-group-events).

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>

  <_PlatformPanel platform="flutter">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="flutter" />

    Chat groups enable real-time messaging among multiple users.

    This page shows how to use the Chat SDK to manage the members of a chat group in your app.

    ## Understand the tech [#understand-the-tech-2]

    The Chat SDK provides the `ChatGroup`, `ChatGroupManager`, and `ChatGroupEventHandler` classes for chat group management, which allows you to implement the following features:

    ## Prerequisites [#prerequisites-2]

    Before proceeding, ensure that you meet the following requirements:

    * You have initialized the Chat SDK. For details, see [SDK quickstart](../../../get-started-sdk).
    * You understand the call frequency limits of the Chat APIs supported by different pricing plans as described in [Limitations](../../limitations).
    * You understand the number of chat groups and chat group members supported by different pricing plans as described in [Pricing Plan Details](../../../reference/pricing-plan-details).

    ## Implementation [#implementation-2]

    This section describes how to call the APIs provided by the Chat SDK to implement chat group features.

    ### Add a user to a chat group [#add-a-user-to-a-chat-group]

    The logic of adding a user to a chat group varies according to the `GroupStyle` and `inviteNeedConfirm` settings when creating the chat group. For details, see [Create a Chat Group](./manage-chat-groups#create-a-chat-group).

    The following code sample shows how to call `addMembers` to add a user to a chat group:

    ```dart
    try {
      await ChatClient.getInstance.groupManager.addMembers(groupId, members);
    } on ChatError catch (e) {
    }
    ```

    ### Remove a member from a chat group [#remove-a-member-from-a-chat-group]

    Only the chat group owner and admins can call `removeMembers` to remove one or more members from a chat group. Once removed from the chat group, the member receives the `ChatGroupEventHandler#onUserRemovedFromGroup` callback, while all the other members receive the `ChatGroupEventHandler#onMembersExitedFromGroup` callback. Users can join the chat group again after being removed.

    The following code sample shows how to remove a member from a chat group:

    ```dart
    try {
      await ChatClient.getInstance.groupManager.removeMembers(groupId, members);
    } on ChatError catch (e) {
    }
    ```

    ### Manage the chat group owner and admins [#manage-the-chat-group-owner-and-admins]

    #### Transfer the chat group ownership [#transfer-the-chat-group-ownership]

    Only the chat group owner can call `changeOwner` to transfer the ownership to the specified chat group member. Once the ownership is transferred, the former chat group owner becomes a regular member, and the new owner receives the `ChatGroupEventHandler#onOwnerChangedFromGroup` callback.

    The following code sample shows how to transfer the chat group ownership:

    ```dart
    try {
      await ChatClient.getInstance.groupManager.changeOwner(groupId, newOwner);
    } on ChatError catch (e) {
    }
    ```

    #### Add a chat group admin [#add-a-chat-group-admin]

    Only the chat group owner can call `addAdmin` to add an admin. Once promoted to an admin, the new admin and the other chat group admins receive the `ChatGroupEventHandler#onAdminAddedFromGroup` callback.

    The following code sample shows how to add a chat group admin:

    ```dart
    try {
      ChatClient.getInstance.groupManager.addAdmin(groupId, memberId);
    } on ChatError catch (e) {
    }
    ```

    #### Remove a chat group admin [#remove-a-chat-group-admin]

    Only the chat group owner can call `removeAdmin` to remove an admin. Once demoted to a regular member, the former admin and the other chat group admins receive the `ChatGroupEventHandler#onAdminRemovedFromGroup` callback.

    The following code sample shows how to remove a chat group admin:

    ```dart
    try {
      await ChatClient.getInstance.groupManager.removeAdmin(groupId, adminId);
    } on ChatError catch (e) {
    }
    ```

    ### Manage the chat group blocklist [#manage-the-chat-group-blocklist-2]

    #### Add a member to the chat group blocklist [#add-a-member-to-the-chat-group-blocklist]

    Only the chat group owner and admins can call `blockMembers` to add the specified member to the chat group blocklist. Once added to the blocklist, this member receives the `ChatGroupEventHandler#onUserRemovedFromGroup` callback, while all the other members receive the `ChatGroupEventHandler#onMembersExitedFromGroup` callback. After being added to blocklist, this user cannot send or receive messages in the chat group. They can no longer join the chat room until they are removed from the blocklist.

    The following code sample shows how to add a member to the chat group blocklist:

    ```dart
    try {
      await ChatClient.getInstance.groupManager.blockMembers(groupId, members);
    } on ChatError catch (e) {
    }
    ```

    #### Remove a member from the chat group blocklist [#remove-a-member-from-the-chat-group-blocklist]

    Only the chat group owner and admins can call `unblockMembers` to remove the specified member from the chat group blocklist.

    The following code sample shows how to remove a member from the chat group blocklist:

    ```dart
    try {
      await ChatClient.getInstance.groupManager.unblockMembers(groupId, blockIds);
    } on ChatError catch (e) {
    }
    ```

    #### Retrieve the chat group blocklist [#retrieve-the-chat-group-blocklist]

    Only the chat group owner and admins can call `fetchBlockListFromServer` to retrieve the chat group blocklist.

    The following code sample shows how to retrieve the chat group blocklist:

    ```dart
    try {
      await ChatClient.getInstance.groupManager.fetchBlockListFromServer(
        groupId,
        pageNum: pageNum,
        pageSize: pageSize,
      );
    } on ChatError catch (e) {
    }
    ```

    ### Manage the chat group mute list [#manage-the-chat-group-mute-list-2]

    #### Add a member to the chat group mute list [#add-a-member-to-the-chat-group-mute-list]

    Only the chat group owner and admins can call `muteMembers` to add the specified member to the chat group mute list. Once added to the mute list, this member and all the other chat group admins or owner receive the `ChatGroupEventHandler#onMuteListAddedFromGroup` callback. Once a chat group member is added to the chat group mute list, they can no longer send chat group messages, not even after being added to the chat group allow list.

    The following code sample shows how to add a member to the chat group mute list:

    ```dart
    // duration: The mute duration. If you pass `-1`, members are muted permanently.
    try {
      await ChatClient.getInstance.groupManager.muteMembers(
        groupId,
        members,
      );
    } on ChatError catch (e) {
    }
    ```

    #### Remove a member from the chat group mute list [#remove-a-member-from-the-chat-group-mute-list]

    Only the chat group owner and admins can call `unMuteMembers` to remove the specified member from the chat group mute list. Once removed from the chat group mute list, this member and all the other chat group admins or owner receive the `ChatGroupEventHandler#onMuteListRemovedFromGroup` callback.

    The following code sample shows how to remove a member from the chat group mute list:

    ```dart
    try {
      await ChatClient.getInstance.groupManager.unMuteMembers(
        groupId,
        members,
      );
    } on ChatError catch (e) {
    }
    ```

    #### Retrieve the chat group mute list [#retrieve-the-chat-group-mute-list]

    Only the chat group owner and admins can call `fetchMuteListFromServer` to retrieve the chat group mute list from the server.

    The following code sample shows how to retrieve the chat group mute dictionary:

    ```dart
    try {
      await ChatClient.getInstance.groupManager.fetchMuteListFromServer(
        groupId,
        pageNum: pageNum,
        pageSize: pageSize,
      );
    } on ChatError catch (e) {
    }
    ```

    ### Mute all the chat group members [#mute-all-the-chat-group-members]

    Only the chat group owner and admins can call `muteAllMembers` to mute all the chat group members. All members in the group can receive the `ChatGroupEventHandler#onAllMemberMuteStateChanged` event.

    Once all the members are muted, only those in the chat group allow list can send messages in the chat group.

    Unlike muting a chat group member, this kind of mute does not expire automatically after a certain period and you need to call the `unMuteAllMembers` method to unmute all members in the chat group.

    The following sample code shows how to mute all the chat group members:

    ```dart
    try {
      await ChatClient.getInstance.groupManager.muteAllMembers(
        groupId,
      );
    } on ChatError catch (e) {
    }
    ```

    #### Unmute all the chat group members [#unmute-all-the-chat-group-members]

    Only the chat group owner and admins can call `unMuteAllMembers` to unmute all the chat group members. All members in the group can receive the `ChatGroupEventHandler#onAllMemberMuteStateChanged` event.

    The following sample code shows how to unmute all the chat group members:

    ```dart
    try {
      await ChatClient.getInstance.groupManager.unMuteAllMembers(
        groupId,
      );
    } on ChatError catch (e) {
    }
    ```

    ### Manage the chat group allow list [#manage-the-chat-group-allow-list-2]

    The chat group owner and admins are added to the chat group allow list by default.

    #### Add a member to the chat group allow list [#add-a-member-to-the-chat-group-allow-list]

    Only the chat group owner and admins can call `addAllowList` to add the specified member to the chat group allow list. Members in the chat group allow list can send chat group messages even when the chat group owner or admin has muted all chat group members. However, if a member is already in the chat group mute list, this member still cannot send messages in the group even after being added to the group allow list.

    The following code sample shows how to add a member to the chat group allow list:

    ```dart
    try {
      await ChatClient.getInstance.groupManager.addAllowList(
        groupId,
        members,
      );
    } on ChatError catch (e) {
    }
    ```

    #### Remove a member from the chat group allow list [#remove-a-member-from-the-chat-group-allow-list]

    Only the chat group owner and admins can call `removeAllowList` to remove the specified member from the chat group allow list.

    The following code sample shows how to remove a member from the chat group allow list:

    ```dart
    try {
      await ChatClient.getInstance.groupManager.removeAllowList(
        groupId,
        members,
      );
    } on ChatError catch (e) {
    }
    ```

    #### Check whether a user is added to the allow list [#check-whether-a-user-is-added-to-the-allow-list]

    All chat group members can call `isMemberInAllowListFromServer` to check whether they are added to the chat group allow list.

    The following code sample shows how to check whether a user is on the chat group allow list:

    ```dart
    try {
      bool check = await ChatClient.getInstance.groupManager.isMemberInAllowListFromServer(
        groupId,
      );
    } on ChatError catch (e) {
    }
    ```

    #### Retrieve the chat group allow list [#retrieve-the-chat-group-allow-list]

    Only the chat group owner and admins can call `fetchAllowListFromServer` to retrieve the chat group allow list.

    The following code sample shows how to retrieve the chat group allow list:

    ```dart
    try {
      List? list =
          await ChatClient.getInstance.groupManager.fetchAllowListFromServer(
        groupId,
      );
    } on ChatError catch (e) {
    }
    ```

    ### Listen for chat group events [#listen-for-chat-group-events-2]

    For details, see [Chat Group Events](./manage-chat-groups#listen-for-chat-group-events).

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>

  <_PlatformPanel platform="react-native">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="react-native" />

    Chat groups enable real-time messaging among multiple users.

    This page shows how to use the Chat SDK to manage the members of a chat group in your app.

    ## Understand the tech [#understand-the-tech-3]

    The Chat SDK provides the `ChatGroup`, `ChatGroupManager`, and `ChatGroupEventListener` classes for chat group management, which allows you to implement the following features:

    ## Prerequisites [#prerequisites-3]

    Before proceeding, ensure that you meet the following requirements:

    * You have initialized the Chat SDK. For details, see [SDK quickstart](../../../get-started-sdk).
    * You understand the call frequency limits of the Chat APIs supported by different pricing plans as described in [Limitations](../../limitations).
    * You understand the number of chat groups and chat group members supported by different pricing plans as described in [Pricing Plan Details](../../../reference/pricing-plan-details).

    ## Implementation [#implementation-3]

    This section describes how to call the APIs provided by the Chat SDK to implement chat group features.

    ### Add a user to a chat group [#add-a-user-to-a-chat-group-1]

    The logic of adding a user to a chat group varies according to the `GroupStyle` and `inviteNeedConfirm` settings when creating the chat group. For details, see [Create a Chat Group](./manage-chat-groups#create-a-chat-group).

    The following code sample shows how to call `addMembers` to add a user to a chat group:

    ```typescript
    const groupId = "100";
    const members = ["Tom", "Json"];
    const welcome = "Welcome to you";
    ChatClient.getInstance()
      .groupManager.addMembers(groupId, members, welcome)
      .then(() => {
        console.log("add members success.");
      })
      .catch((reason) => {
        console.log("add members fail.", reason);
      });
    ```

    ### Remove a member from a chat group [#remove-a-member-from-a-chat-group-1]

    Only the chat group owner and admins can call `removeMembers` to remove one or more members from a chat group. Once removed from the chat group, the member receives the `ChatGroupEventListener#onUserRemoved` callback, while all the other members receive the `ChatGroupEventListener#onMembersExited` callback. Users can join the chat group again after being removed.

    The following code sample shows how to remove a member from a chat group:

    ```typescript
    ChatClient.getInstance()
      .groupManager.removeMembers(groupId, members)
      .then(() => {
        console.log("remove members success.");
      })
      .catch((reason) => {
        console.log("remove members fail.", reason);
      });
    ```

    ### Manage the chat group owner and admins [#manage-the-chat-group-owner-and-admins-1]

    #### Transfer the chat group ownership [#transfer-the-chat-group-ownership-1]

    Only the chat group owner can call `changeOwner` to transfer the ownership to the specified chat group member. Once the ownership is transferred, the former chat group owner becomes a regular member, and the new owner receives the `ChatGroupEventListener#OnOwnerChanged` callback.

    The following code sample shows how to transfer the chat group ownership:

    ```typescript
    ChatClient.getInstance()
      .groupManager.changeOwner(groupId, newOwner)
      .then(() => {
        console.log("change owner success.");
      })
      .catch((reason) => {
        console.log("change owner fail.", reason);
      });
    ```

    #### Add a chat group admin [#add-a-chat-group-admin-1]

    Only the chat group owner can call `addAdmin` to add an admin. Once promoted to an admin, the new admin and the other chat group admins receive the `ChatGroupEventListener#OnAdminAdded` callback.

    The following code sample shows how to add a chat group admin:

    ```typescript
    ChatClient.getInstance()
      .groupManager.addAdmin(groupId, memberId)
      .then(() => {
        console.log("add admin success.");
      })
      .catch((reason) => {
        console.log("add admin fail.", reason);
      });
    ```

    #### Remove a chat group admin [#remove-a-chat-group-admin-1]

    Only the chat group owner can call `removeAdmin` to remove an admin. Once demoted to a regular member, the former admin and the other chat group admins receive the `ChatGroupEventListener#OnAdminRemoved` callback.

    The following code sample shows how to remove a chat group admin:

    ```typescript
    ChatClient.getInstance()
      .groupManager.removeAdmin(groupId, memberId)
      .then(() => {
        console.log("remove admin success.");
      })
      .catch((reason) => {
        console.log("remove admin fail.", reason);
      });
    ```

    ### Manage the chat group blocklist [#manage-the-chat-group-blocklist-3]

    #### Add a member to the chat group blocklist [#add-a-member-to-the-chat-group-blocklist-1]

    Only the chat group owner and admins can call `blockMembers` to add the specified member to the chat group blocklist. Once added to the blocklist, this member receives the `ChatGroupEventListener#onUserRemoved` callback, while all the other members receive the `ChatGroupEventListener#onMembersExited` callback. After being added to blocklist, this user cannot send or receive messages in the chat group. They can no longer join the chat room until they are removed from the blocklist.

    The following code sample shows how to add a member to the chat group blocklist:

    ```typescript
    ChatClient.getInstance()
      .groupManager.blockMembers(groupId, members)
      .then(() => {
        console.log("block members success.");
      })
      .catch((reason) => {
        console.log("block members fail.", reason);
      });
    ```

    #### Remove a member from the chat group blocklist [#remove-a-member-from-the-chat-group-blocklist-1]

    Only the chat group owner and admins can call `unblockMembers` to remove the specified member from the chat group blocklist.

    The following code sample shows how to remove a member from the chat group blocklist:

    ```typescript
    ChatClient.getInstance()
      .groupManager.unblockMembers(groupId, members)
      .then(() => {
        console.log("unblock members success.");
      })
      .catch((reason) => {
        console.log("unblock members fail.", reason);
      });
    ```

    #### Retrieve the chat group blocklist [#retrieve-the-chat-group-blocklist-1]

    Only the chat group owner and admins can call `fetchBlockListFromServer` to retrieve the chat group blocklist.

    The following code sample shows how to retrieve the chat group blocklist:

    ```typescript
    ChatClient.getInstance()
      .groupManager.fetchBlockListFromServer(groupId, pageSize, pageNum)
      .then((list) => {
        console.log("get block members success: ", list);
      })
      .catch((reason) => {
        console.log("get block members fail.", reason);
      });
    ```

    ### Manage the chat group mute list [#manage-the-chat-group-mute-list-3]

    #### Add a member to the chat group mute list [#add-a-member-to-the-chat-group-mute-list-1]

    Only the chat group owner and admins can call `muteMembers` to add the specified member to the chat group mute list. Once added to the mute list, this member and all the other chat group admins or owner receive the `ChatGroupEventListener#onMuteListAdded` callback. Once a chat group member is added to the chat group mute list, they can no longer send chat group messages, not even after being added to the chat group allow list.

    The following code sample shows how to add a member to the chat group mute list:

    ```typescript
    // duration: The mute duration. If you pass `-1`, members are muted permanently.
    ChatClient.getInstance()
      .groupManager.muteMembers(groupId, members, duration)
      .then(() => {
        console.log("mute members success.");
      })
      .catch((reason) => {
        console.log("mute members fail.", reason);
      });
    ```

    #### Remove a member from the chat group mute list [#remove-a-member-from-the-chat-group-mute-list-1]

    Only the chat group owner and admins can call `unMuteMembers` to remove the specified member from the chat group mute list. Once removed from the chat group mute list, this member and all the other chat group admins or owner receive the `ChatGroupEventListener#onMuteListRemoved` callback.

    The following code sample shows how to remove a member from the chat group mute list:

    ```typescript
    ChatClient.getInstance()
      .groupManager.unMuteMembers(groupId, members)
      .then(() => {
        console.log("unMute members success.");
      })
      .catch((reason) => {
        console.log("unMute members fail.", reason);
      });
    ```

    #### Retrieve the chat group mute list [#retrieve-the-chat-group-mute-list-1]

    Only the chat group owner and admins can call `fetchMuteListFromServer` to retrieve the chat group mute list from the server.

    The following code sample shows how to retrieve the chat group mute dictionary:

    ```typescript
    ChatClient.getInstance()
      .groupManager.fetchMuteListFromServer(groupId, pageSize, pageNum)
      .then((list) => {
        console.log("get mute list success: ", list);
      })
      .catch((reason) => {
        console.log("get mute list fail.", reason);
      });
    ```

    ### Mute and unmute all the chat group members [#mute-and-unmute-all-the-chat-group-members-2]

    #### Mute all the chat group members [#mute-all-the-chat-group-members-1]

    Only the chat group owner and admins can call `muteAllMembers` to mute all the chat group members. All members in the group can receive the `ChatGroupEventListener#onAllGroupMemberMuteStateChanged` event.

    Once all the members are muted, only those in the chat group allow list can send messages in the chat group.

    Unlike muting a chat group member, this kind of mute does not expire automatically after a certain period and you need to call the `unMuteAllMembers` method to unmute all members in the chat group.

    The following sample code shows how to mute all the chat group members:

    ```typescript
    ChatClient.getInstance()
      .groupManager.muteAllMembers(groupId)
      .then(() => {
        console.log("mute all members success.");
      })
      .catch((reason) => {
        console.log("mute all members fail.", reason);
      });
    ```

    #### Unmute all the chat group members [#unmute-all-the-chat-group-members-1]

    Only the chat group owner and admins can call `unMuteAllMembers` to unmute all the chat group members. All members in the group can receive the `ChatGroupEventListener#onAllGroupMemberMuteStateChanged` event.

    The following sample code shows how to unmute all the chat group members:

    ```typescript
    ChatClient.getInstance()
      .groupManager.unMuteAllMembers(groupId)
      .then(() => {
        console.log("unMute all members success.");
      })
      .catch((reason) => {
        console.log("unMute all members fail.", reason);
      });
    ```

    ### Manage the chat group allow list [#manage-the-chat-group-allow-list-3]

    The chat group owner and admins are added to the chat group allow list by default.

    #### Add a member to the chat group allow list [#add-a-member-to-the-chat-group-allow-list-1]

    Only the chat group owner and admins can call `addAllowList` to add the specified member to the chat group allow list. Members in the chat group allow list can send chat group messages even when the chat group owner or admin has muted all chat group members. However, if a member is already in the chat group mute list, this member still cannot send messages in the group even after being added to the group allow list.

    The following code sample shows how to add a member to the chat group allow list:

    ```typescript
    ChatClient.getInstance()
      .groupManager.addAllowList(groupId, members)
      .then(() => {
        console.log("add white list success.");
      })
      .catch((reason) => {
        console.log("add white list fail.", reason);
      });
    ```

    #### Remove a member from the chat group allow list [#remove-a-member-from-the-chat-group-allow-list-1]

    Only the chat group owner and admins can call `removeAllowList` to remove the specified member from the chat group allow list.

    The following code sample shows how to remove a member from the chat group allow list:

    ```typescript
    ChatClient.getInstance()
      .groupManager.removeAllowList(groupId, members)
      .then(() => {
        console.log("remove white list success.");
      })
      .catch((reason) => {
        console.log("remove white list fail.", reason);
      });
    ```

    #### Check whether a user is added to the allow list [#check-whether-a-user-is-added-to-the-allow-list-1]

    All chat group members can call `isMemberInAllowListFromServer` to check whether they are added to the chat group allow list.

    The following code sample shows how to check whether a user is on the chat group allow list:

    ```typescript
    ChatClient.getInstance()
      .groupManager.isMemberInAllowListFromServer(groupId)
      .then((isMember) => {
        console.log("is member success: ", isMember);
      })
      .catch((reason) => {
        console.log("is member fail.", reason);
      });
    ```

    #### Retrieve the chat group allow list [#retrieve-the-chat-group-allow-list-1]

    Only the chat group owner and admins can call `fetchAllowListFromServer` to retrieve the chat group allow list.

    The following code sample shows how to retrieve the chat group allow list:

    ```typescript
    ChatClient.getInstance()
      .groupManager.fetchAllowListFromServer(groupId)
      .then(() => {
        console.log("get white list success.");
      })
      .catch((reason) => {
        console.log("get white list fail.", reason);
      });
    ```

    ### Listen for chat group events [#listen-for-chat-group-events-3]

    For details, see [Chat Group Events](./manage-chat-groups#listen-for-chat-group-events).

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>

  <_PlatformPanel platform="windows">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="windows" />

    Chat groups enable real-time messaging among multiple users.

    This page shows how to use the Chat SDK to manage the members of a chat group in your app.

    ## Understand the tech [#understand-the-tech-4]

    The Chat SDK provides the `Group`, `IGroupManager`, and `IGroupManagerDelegate` classes for chat group management, which allows you to implement the following features:

    ## Prerequisites [#prerequisites-4]

    Before proceeding, ensure that you meet the following requirements:

    * You have initialized the Chat SDK. For details, see [SDK quickstart](../../../get-started-sdk).
    * You understand the call frequency limits of the Chat APIs supported by different pricing plans as described in [Limitations](../../limitations).
    * You understand the number of chat groups and chat group members supported by different pricing plans as described in [Pricing Plan Details](../../../reference/pricing-plan-details).

    ## Implementation [#implementation-4]

    This section describes how to call the APIs provided by the Chat SDK to implement chat group features.

    ### Add a user to a chat group [#add-a-user-to-a-chat-group-2]

    The logic of adding a user to a chat group varies according to the `GroupStyle` and `inviteNeedConfirm` settings when creating the chat group. For details, see [Create a Chat Group](./manage-chat-groups#create-a-chat-group).

    The following code sample shows how to call `AddGroupMembers` to add a user to a chat group:

    ```csharp
    SDKClient.Instance.GroupManager.AddGroupMembers(groupId, members, new CallBack(
      onSuccess: () =>
      {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    ### Remove a member from a chat group [#remove-a-member-from-a-chat-group-2]

    Only the chat group owner and admins can call `DeleteGroupMembers` to remove one or more member from a chat group. Once removed from the chat group, the member receives the `IGroupManagerDelegate#OnUserRemovedFromGroup` callback, while all the other members receive the `IGroupManagerDelegate#OnMembersExitedFromGroup` callback. Users can join the chat group again after being removed.

    The following code sample shows how to remove a member from a chat group:

    ```csharp
    SDKClient.Instance.GroupManager.DeleteGroupMembers(groupId, list, new CallBack (
      onSuccess: () =>
      {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    ### Manage the chat group owner and admins [#manage-the-chat-group-owner-and-admins-2]

    #### Transfer the chat group ownership [#transfer-the-chat-group-ownership-2]

    Only the chat group owner can call `ChangeGroupOwner` to transfer the ownership to the specified chat group member. Once the ownership is transferred, the former chat group owner becomes a regular member, and the new owner receives the `IGroupManagerDelegate#OnOwnerChangedFromGroup` callback.

    The following code sample shows how to transfer the chat group ownership:

    ```csharp
    SDKClient.Instance.GroupManager.ChangeGroupOwner(groupId, newOwner, new CallBack(
      onSuccess: () =>
      {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    #### Add a chat group admin [#add-a-chat-group-admin-2]

    Only the chat group owner can call `AddGroupAdmin` to add an admin. Once promoted to an admin, the new admin and the other chat group admins receive the `IGroupManagerDelegate#OnAdminAddedFromGroup` callback.

    The following code sample shows how to add a chat group admin:

    ```csharp
    SDKClient.Instance.GroupManager.AddGroupAdmin(groupId, adminId, new CallBack(
      onSuccess: () =>
      {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    #### Remove a chat group admin [#remove-a-chat-group-admin-2]

    Only the chat group owner can call `RemoveGroupAdmin` to remove an admin. Once demoted to a regular member, the former admin and the other chat group admins receive the `IGroupManagerDelegate#OnAdminRemovedFromGroup` callback.

    The following code sample shows how to remove a chat group admin:

    ```csharp
    SDKClient.Instance.GroupManager.RemoveGroupAdmin(groupId, adminId, new CallBack(
      onSuccess: () =>
      {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    ### Manage the chat group blocklist [#manage-the-chat-group-blocklist-4]

    #### Add a member to the chat group blocklist [#add-a-member-to-the-chat-group-blocklist-2]

    Only the chat group owner and admins can call `BlockGroupMembers` to add the specified member to the chat group blocklist. Once added to the blocklist, this member receives the `IGroupManagerDelegate#OnUserRemovedFromGroup` callback, while all the other members receive the `IGroupManagerDelegate#OnMembersExitedFromGroup`. After being added to blocklist, this user cannot send or receive messages in the chat group. They can no longer join the chat group until they are removed from the blocklist.

    The following code sample shows how to add a member to the chat group blocklist:

    ```csharp
    SDKClient.Instance.GroupManager.BlockGroupMembers(groupId, members, new CallBack(
      onSuccess: () =>
      {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    #### Remove a member from the chat group blocklist [#remove-a-member-from-the-chat-group-blocklist-2]

    Only the chat group owner and admins can call `UnBlockGroupMembers` to remove the specified member from the chat group blocklist.

    The following code sample shows how to remove a member from the chat group blocklist:

    ```csharp
    SDKClient.Instance.GroupManager.UnBlockGroupMembers(groupId, members, new CallBack(
      onSuccess: () =>
      {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    #### Retrieve the chat group blocklist [#retrieve-the-chat-group-blocklist-2]

    Only the chat group owner and admins can call `GetGroupBlockListFromServer` to retrieve the chat group blocklist.

    The following code sample shows how to retrieve the chat group blocklist:

    ```csharp
    SDKClient.Instance.GroupManager.GetGroupBlockListFromServer(groupId, pageNum, pageSize, callback: new ValueCallBack>(
      onSuccess: (list) =>
      {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    ### Manage the chat group mute list [#manage-the-chat-group-mute-list-4]

    #### Add a member to the chat group mute list [#add-a-member-to-the-chat-group-mute-list-2]

    Only the chat group owner and admins can call `MuteGroupMembers` to add the specified member to the chat group mute list. Once added to the mute list, this member and all the other chat group admins or owner receive the `IGroupManagerDelegate#OnMuteListAddedFromGroup` callback. Once a chat group member is added to the chat group mute list, they can no longer send chat group messages, not even after being added to the chat group allow list.

    The following code sample shows how to add a member to the chat group mute list:

    ```csharp
    // muteMilliseconds: The mute duration. If you pass `-1`, members are muted permanently.
    SDKClient.Instance.GroupManager.MuteGroupMembers(groupId, members, new CallBack(
      onSuccess: () =>
      {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    #### Remove a member from the chat group mute list [#remove-a-member-from-the-chat-group-mute-list-2]

    Only the chat group owner and admins can call `UnMuteGroupMembers` to remove the specified member from the chat group mute list. Once removed from the chat group mute list, this member and all the other chat group admins or owner receive the `IGroupManagerDelegate#OnMuteListRemovedFromGroup` callback.

    The following code sample shows how to remove a member from the chat group mute list:

    ```csharp
    SDKClient.Instance.GroupManager.UnMuteGroupMembers(groupId, members, new CallBack(
      onSuccess: () =>
      {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    #### Retrieve the chat group mute list [#retrieve-the-chat-group-mute-list-2]

    Only the chat group owner and admins can call `GetGroupMuteListFromServer` to retrieve the chat group mute list from the server.

    The following code sample shows how to retrieve the chat group mute dictionary:

    ```csharp
    SDKClient.Instance.GroupManager.GetGroupMuteListFromServer(groupId, callback: new ValueCallBack>(
      onSuccess: (list) => {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    ### Mute and unmute all the chat group members [#mute-and-unmute-all-the-chat-group-members-3]

    #### Mute all the chat group members [#mute-all-the-chat-group-members-2]

    Only the chat group owner and admins can call `MuteGroupAllMembers` to mute all the chat group members. All members in the group receive the `IGroupManagerDelegate#OnAllMemberMuteChangedFromGroup` event and only those in the chat group allow list can send messages in the chat group.

    Unlike muting a chat group member, this kind of mute does not expire automatically after a certain period and you need to call the `UnMuteGroupAllMembers` method to unmute all members in the chat group.

    The following sample code shows how to mute all the chat group members:

    ```csharp
    SDKClient.Instance.GroupManager.MuteGroupAllMembers(groupId, new CallBack(
      onSuccess: () => {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    #### Unmute all the chat group members [#unmute-all-the-chat-group-members-2]

    Only the chat group owner and admins can call `UnMuteGroupAllMembers` to unmute all the chat group members. All members in the group receive the `IGroupManagerDelegate#OnAllMemberMuteChangedFromGroup` event.

    The following sample code shows how to unmute all the chat group members:

    ```csharp
    SDKClient.Instance.GroupManager.UnMuteGroupAllMembers(groupId, new CallBack(
      onSuccess: () => {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    ### Manage the chat group allow list [#manage-the-chat-group-allow-list-4]

    The chat group owner and admins are added to the chat group allow list by default.

    #### Add a member to the chat group allow list [#add-a-member-to-the-chat-group-allow-list-2]

    Only the chat group owner and admins can call `AddGroupWhiteList` to add the specified member to the chat group allow list. Members in the chat group allow list can send chat group messages even when the chat group owner or admin has muted all chat group members. However, if a member is already in the chat group mute list, this member still cannot send messages in the group even after being added to the group allow list.

    The following code sample shows how to add a member to the chat group allow list:

    ```csharp
    SDKClient.Instance.GroupManager.AddGroupWhiteList(groupId, members, new CallBack(
      onSuccess: () => {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    #### Remove a member from the chat group allow list [#remove-a-member-from-the-chat-group-allow-list-2]

    Only the chat group owner and admins can call `RemoveGroupWhiteList` to remove the specified member from the chat group allow list.

    The following code sample shows how to remove a member from the chat group allow list:

    ```csharp
    SDKClient.Instance.GroupManager.RemoveGroupWhiteList(groupId, members, new CallBack(
      onSuccess: () => {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    #### Check whether a user is added to the allow list [#check-whether-a-user-is-added-to-the-allow-list-2]

    All chat group members can call `checkIfInGroupWhiteList` to check whether they are added to the chat group allow list.

    The following code sample shows how to check whether a user is on the chat group allow list:

    ```csharp
    public void checkIfInGroupWhiteList(final String groupId, EMValueCallBack callBack)
    SDKClient.Instance.GroupManager.CheckIfInGroupWhiteList(groupId, new ValueCallBack(
      onSuccess: (ret) => {
      },
      onError: (code, desc)=> {
      }
    ));
    ```

    #### Retrieve the chat group allow list [#retrieve-the-chat-group-allow-list-2]

    Only the chat group owner and admins can call `GetGroupWhiteListFromServer` to retrieve the chat group allow list.

    The following code sample shows how to retrieve the chat group allow list:

    ```csharp
    SDKClient.Instance.GroupManager.GetGroupWhiteListFromServer(currentGroupId, callback: new ValueCallBack>(
      onSuccess: (list) => {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    ### Listen for chat group events [#listen-for-chat-group-events-4]

    For details, see [Chat Group Events](./manage-chat-groups#listen-for-chat-group-events).

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>

  <_PlatformPanel platform="unity">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="unity" />

    Chat groups enable real-time messaging among multiple users.

    This page shows how to use the Chat SDK to manage the members of a chat group in your app.

    ## Understand the tech [#understand-the-tech-5]

    The Chat SDK provides the `Group`, `IGroupManager`, and `IGroupManagerDelegate` classes for chat group management, which allows you to implement the following features:

    ## Prerequisites [#prerequisites-5]

    Before proceeding, ensure that you meet the following requirements:

    * You have initialized the Chat SDK. For details, see [SDK quickstart](../../../get-started-sdk).
    * You understand the call frequency limits of the Chat APIs supported by different pricing plans as described in [Limitations](../../limitations).
    * You understand the number of chat groups and chat group members supported by different pricing plans as described in [Pricing Plan Details](../../../reference/pricing-plan-details).

    ## Implementation [#implementation-5]

    This section describes how to call the APIs provided by the Chat SDK to implement chat group features.

    ### Add a user to a chat group [#add-a-user-to-a-chat-group-3]

    The logic of adding a user to a chat group varies according to the `GroupStyle` and `inviteNeedConfirm` settings when creating the chat group. For details, see [Create a Chat Group](./manage-chat-groups#create-a-chat-group).

    The following code sample shows how to call `AddGroupMembers` to add a user to a chat group:

    ```csharp
    SDKClient.Instance.GroupManager.AddGroupMembers(groupId, members, new CallBack(
      onSuccess: () =>
      {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    ### Remove a member from a chat group [#remove-a-member-from-a-chat-group-3]

    Only the chat group owner and admins can call `DeleteGroupMembers` to remove one or more members from a chat group. Once removed from the chat group, the member receives the `IGroupManagerDelegate#OnUserRemovedFromGroup` callback, while all the other members receive the `IGroupManagerDelegate#OnMembersExitedFromGroup` callback. Users can join the chat group again after being removed.

    The following code sample shows how to remove a member from a chat group:

    ```csharp
    SDKClient.Instance.GroupManager.DeleteGroupMembers(groupId, list, new CallBack (
      onSuccess: () =>
      {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    ### Manage the chat group owner and admins [#manage-the-chat-group-owner-and-admins-3]

    #### Transfer the chat group ownership [#transfer-the-chat-group-ownership-3]

    Only the chat group owner can call `ChangeGroupOwner` to transfer the ownership to the specified chat group member. Once the ownership is transferred, the former chat group owner becomes a regular member, and the new owner receives the `IGroupManagerDelegate#OnOwnerChangedFromGroup` callback.

    The following code sample shows how to transfer the chat group ownership:

    ```csharp
    SDKClient.Instance.GroupManager.ChangeGroupOwner(groupId, newOwner, new CallBack(
      onSuccess: () =>
      {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    #### Add a chat group admin [#add-a-chat-group-admin-3]

    Only the chat group owner can call `AddGroupAdmin` to add an admin. Once promoted to an admin, the new admin and the other chat group admins receive the `IGroupManagerDelegate#OnAdminAddedFromGroup` callback.

    The following code sample shows how to add a chat group admin:

    ```csharp
    SDKClient.Instance.GroupManager.AddGroupAdmin(groupId, adminId, new CallBack(
      onSuccess: () =>
      {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    #### Remove a chat group admin [#remove-a-chat-group-admin-3]

    Only the chat group owner can call `RemoveGroupAdmin` to remove an admin. Once demoted to a regular member, the former admin and the other chat group admins receive the `IGroupManagerDelegate#OnAdminRemovedFromGroup` callback.

    The following code sample shows how to remove a chat group admin:

    ```csharp
    SDKClient.Instance.GroupManager.RemoveGroupAdmin(groupId, adminId, new CallBack(
      onSuccess: () =>
      {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    ### Manage the chat group blocklist [#manage-the-chat-group-blocklist-5]

    #### Add a member to the chat group blocklist [#add-a-member-to-the-chat-group-blocklist-3]

    Only the chat group owner and admins can call `BlockGroupMembers` to add the specified member to the chat group blocklist. Once added to the blocklist, this member receives the `IGroupManagerDelegate#OnUserRemovedFromGroup` callback, while all the other members receive the `IGroupManagerDelegate#OnMembersExitedFromGroup`. After being added to blocklist, this user cannot send or receive messages in the chat group. They can no longer join the chat group until they are removed from the blocklist.

    The following code sample shows how to add a member to the chat group blocklist:

    ```csharp
    SDKClient.Instance.GroupManager.BlockGroupMembers(groupId, members, new CallBack(
      onSuccess: () =>
      {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    #### Remove a member from the chat group blocklist [#remove-a-member-from-the-chat-group-blocklist-3]

    Only the chat group owner and admins can call `UnBlockGroupMembers` to remove the specified member from the chat group blocklist.

    The following code sample shows how to remove a member from the chat group blocklist:

    ```csharp
    SDKClient.Instance.GroupManager.UnBlockGroupMembers(groupId, members, new CallBack(
      onSuccess: () =>
      {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    #### Retrieve the chat group blocklist [#retrieve-the-chat-group-blocklist-3]

    Only the chat group owner and admins can call `GetGroupBlockListFromServer` to retrieve the chat group blocklist.

    The following code sample shows how to retrieve the chat group blocklist:

    ```csharp
    SDKClient.Instance.GroupManager.GetGroupBlockListFromServer(groupId, pageNum, pageSize, callback: new ValueCallBack>(
      onSuccess: (list) =>
      {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    ### Manage the chat group mute list [#manage-the-chat-group-mute-list-5]

    #### Add a member to the chat group mute list [#add-a-member-to-the-chat-group-mute-list-3]

    Only the chat group owner and admins can call `MuteGroupMembers` to add the specified member to the chat group mute list. Once added to the mute list, this member and all the other chat group admins or owner receive the `IGroupManagerDelegate#OnMuteListAddedFromGroup` callback. Once a chat group member is added to the chat group mute list, they can no longer send chat group messages, not even after being added to the chat group allow list.

    The following code sample shows how to add a member to the chat group mute list:

    ```csharp
    // muteMilliseconds: The mute duration. If you pass `-1`, members are muted permanently.
    SDKClient.Instance.GroupManager.MuteGroupMembers(groupId, members, new CallBack(
      onSuccess: () =>
      {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    #### Remove a member from the chat group mute list [#remove-a-member-from-the-chat-group-mute-list-3]

    Only the chat group owner and admins can call `UnMuteGroupMembers` to remove the specified member from the chat group mute list. Once removed from the chat group mute list, this member and all the other chat group admins or owner receive the `IGroupManagerDelegate#OnMuteListRemovedFromGroup` callback.

    The following code sample shows how to remove a member from the chat group mute list:

    ```csharp
    SDKClient.Instance.GroupManager.UnMuteGroupMembers(groupId, members, new CallBack(
      onSuccess: () =>
      {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    #### Retrieve the chat group mute list [#retrieve-the-chat-group-mute-list-3]

    Only the chat group owner and admins can call `GetGroupMuteListFromServer` to retrieve the chat group mute list from the server.

    The following code sample shows how to retrieve the chat group mute dictionary:

    ```csharp
    SDKClient.Instance.GroupManager.GetGroupMuteListFromServer(groupId, callback: new ValueCallBack>(
      onSuccess: (list) => {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    ### Mute and unmute all the chat group members [#mute-and-unmute-all-the-chat-group-members-4]

    #### Mute all the chat group members [#mute-all-the-chat-group-members-3]

    Only the chat group owner and admins can call `MuteGroupAllMembers` to mute all the chat group members. All members in the group can receive the `IGroupManagerDelegate#OnAllMemberMuteChangedFromGroup` event and only those in the chat group allow list can send messages in the chat group.

    Unlike muting a chat group member, this kind of mute does not expire automatically after a certain period and you need to call the `UnMuteGroupAllMembers` method to unmute all members in the chat group.

    The following sample code shows how to mute all the chat group members:

    ```csharp
    SDKClient.Instance.GroupManager.MuteGroupAllMembers(groupId, new CallBack(
      onSuccess: () => {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    #### Unmute all the chat group members [#unmute-all-the-chat-group-members-3]

    Only the chat group owner and admins can call `UnMuteGroupAllMembers` to unmute all the chat group members. All members in the group can receive the `IGroupManagerDelegate#OnAllMemberMuteChangedFromGroup` event

    The following sample code shows how to unmute all the chat group members:

    ```csharp
    SDKClient.Instance.GroupManager.UnMuteGroupAllMembers(groupId, new CallBack(
      onSuccess: () => {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    ### Manage the chat group allow list [#manage-the-chat-group-allow-list-5]

    The chat group owner and admins are added to the chat group allow list by default.

    #### Add a member to the chat group allow list [#add-a-member-to-the-chat-group-allow-list-3]

    Only the chat group owner and admins can call `AddGroupWhiteList` to add the specified member to the chat group allow list. Members in the chat group allow list can send chat group messages even when the chat group owner or admin has muted all chat group members. However, if a member is already in the chat group mute list, this member still cannot send messages in the group even after being added to the group allow list.

    The following code sample shows how to add a member to the chat group allow list:

    ```csharp
    SDKClient.Instance.GroupManager.AddGroupWhiteList(groupId, members, new CallBack(
      onSuccess: () => {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    #### Remove a member from the chat group allow list [#remove-a-member-from-the-chat-group-allow-list-3]

    Only the chat group owner and admins can call `RemoveGroupWhiteList` to remove the specified member from the chat group allow list.

    The following code sample shows how to remove a member from the chat group allow list:

    ```csharp
    SDKClient.Instance.GroupManager.RemoveGroupWhiteList(groupId, members, new CallBack(
      onSuccess: () => {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    #### Check whether a user is added to the allow list [#check-whether-a-user-is-added-to-the-allow-list-3]

    All chat group members can call `checkIfInGroupWhiteList` to check whether they are added to the chat group allow list.

    The following code sample shows how to check whether a user is on the chat group allow list:

    ```csharp
    public void checkIfInGroupWhiteList(final String groupId, EMValueCallBack callBack)
    SDKClient.Instance.GroupManager.CheckIfInGroupWhiteList(groupId, new ValueCallBack(
      onSuccess: (ret) => {
      },
      onError: (code, desc)=> {
      }
    ));
    ```

    #### Retrieve the chat group allow list [#retrieve-the-chat-group-allow-list-3]

    Only the chat group owner and admins can call `GetGroupWhiteListFromServer` to retrieve the chat group allow list.

    The following code sample shows how to retrieve the chat group allow list:

    ```csharp
    SDKClient.Instance.GroupManager.GetGroupWhiteListFromServer(currentGroupId, callback: new ValueCallBack>(
      onSuccess: (list) => {
      },
      onError: (code, desc) =>
      {
      }
    ));
    ```

    ### Listen for chat group events [#listen-for-chat-group-events-5]

    For details, see [Chat Group Events](./manage-chat-groups#listen-for-chat-group-events).

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>

  <_PlatformPanel platform="web">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="web" />

    Chat groups enable real-time messaging among multiple users.

    This page shows how to use the Chat SDK to manage the members of a chat group in your app.

    ## Understand the tech [#understand-the-tech-6]

    The Chat SDK provides the `GroupManager` and `Group` classes for chat group management, which allows you to implement the following features:

    * Add and remove users from a chat group
    * Manage the owner and admins of a chat group
    * Manage the blocklist of a chat group
    * Manage the mute list of a chat group
    * Mute and unmute all the chat group members
    * Manage the allow list of a chat group

    ## Prerequisites [#prerequisites-6]

    Before proceeding, ensure that you meet the following requirements:

    * You have initialized the Chat SDK. For details, see [SDK quickstart](../../../get-started-sdk).
    * You understand the call frequency limits of the Chat APIs supported by different pricing plans as described in [Limitations](../../limitations).
    * You understand the number of chat groups and chat group members supported by different pricing plans as described in [Pricing Plan Details](../../../reference/pricing-plan-details).

    ## Implementation [#implementation-6]

    This section describes how to call the APIs provided by the Chat SDK to implement chat group features.

    ### Manage chat group members [#manage-chat-group-members-2]

    1. Add users to a chat group.
       Whether a chat group is public or private, the chat group owner and chat group admins can add users to the chat group. If the `allowinvites` parameter of the group type is set to `true`, group members can also invite users to join the chat group.

    2. Implement chat group invitations.
       After the user is invited to join a group, the implementation logic varies based on the setting of the group option `inviteNeedConfirm`:

       * If `inviteNeedConfirm` is set to `true`, there are two cases:

         * The user calls `acceptGroupJoinRequest` to accept the group invitation. After the user successfully joins the group, the inviter receives the `acceptInvite` callback and all group members receive the `memberPresence` callback.
         * The user calls `rejectGroupJoinRequest` to decline the group invitation. In this case, the inviter receives the `rejectInvite` callback.

       * If `inviteNeedConfirm` is set to false, the user is directly added to the chat group without confirming the group invitation. All group members receive the `memberPresence` callback.

    3. Remove chat group members from a chat group.
       The chat group owner and chat group admins can remove chat group members from a chat group, whereas chat group members do not have this privilege. Once removed from the group, the member receives the `removeMember` callback and all the other group members receive the `memberAbsence` callback.

    Refer to the following sample code to add and remove a user:

    ```javascript
    // Group members can call inviteUsersToGroup to add users to a chat group.
    const options = {
      users: ["user1", "user2"],
      groupId: "groupId",
    };
    chatClient.inviteUsersToGroup(options).then((res) => console.log(res));

    // The chat group owner and chat group admins can call removeGroupMember to remove a group member from a chat group.
    const options = {
      groupId: "groupId",
      username: "username",
    };
    chatClient.removeGroupMember(options).then((res) => console.log(res));
    // The chat group owner and chat group admins can call removeGroupMembers to remove members from a chat group.
    chatClient.removeGroupMembers({
      groupId: "groupId",
      users: ["user1", "user2"],
    });
    ```

    ### Manage chat group ownership and admin [#manage-chat-group-ownership-and-admin-2]

    1. Transfer the chat group ownership.
       The chat group owner can transfer ownership to the specified chat group member. Once ownership is transferred, the original chat group owner becomes a group member. The new owner receives the `changeOwner` callback.

    2. Add chat group admins.
       The chat group owner can add admins. Once added to the chat group admin list, the newly added admin and the other chat group admins receive the `setAdmin` callback.

    3. Remove chat group admins.
       The chat group owner can remove admins. Once removed from the chat group admin list, the removed admin and the other chat group admins receive the `removeGroupAdmin` callback.

    Refer to the following sample code to manage chat group ownership and admin:

    ```javascript
    // The chat group owner can call changeGroupOwner to transfer ownership to the specified chat group member.
    const options = {
      groupId: "groupId",
      newOwner: "username",
    };
    chatClient.changeGroupOwner(options).then((res) => console.log(res));

    // The chat group owner can call setGroupAdmin to add admins.
    const options = {
      groupId: "groupId",
      username: "user",
    };
    chatClient.setGroupAdmin(options).then((res) => console.log(res));

    // The chat group owner can call removeGroupAdmin to remove admins.
    const options = {
      groupId: "groupId",
      username: "user",
    };
    chatClient.removeGroupAdmin(options).then((res) => console.log(res));
    ```

    ### Manage the chat group blocklist [#manage-the-chat-group-blocklist-6]

    The chat group owner and chat group admins can add or remove the specified member to the chat group blocklist. Once a chat group member is added to the blocklist, this member cannot send or receive chat group messages, nor can this member join the chat group again.

    Refer to the following sample code to manage the chat group blocklist:

    ```javascript
    // The chat group owner and admins call blockGroupMember to add the specified member to the chat group blocklist.
    const options = {
      groupId: "groupId",
      usernames: ["user1", "user2"],
    };
    chatClient.blockGroupMember(options).then((res) => console.log(res));

    // The chat group owner and admins can call unblockGroupMembers to remove the specified member from the chat group blocklist.
    // Once removed, the removed member can request to join the chat group again.
    const options = {
      groupId: "groupId",
      username: ["user1", "user2"],
    };
    chatClient.unblockGroupMembers(options).then((res) => console.log(res));

    // The chat group owner and admins can call getGroupBlocklist to retrieve the chat group blocklist.
    const options = {
      groupId: "groupId",
    };
    chatClient.getGroupBlocklist(options).then((res) => console.log(res));
    ```

    ### Manage the chat group mute list [#manage-the-chat-group-mute-list-6]

    The chat group owner and chat group admins can add or remove the specified member to the chat group mute list. Once a chat group member is added to the mute list, this member can no longer send chat group messages, not even after being added to the chat group allow list.

    Refer to the following sample code to manage the chat group mute list:

    ```javascript
    // The chat group owner and admins can call muteGroupMember to add the specified member to the chat group mute list.
    // The muted member and all the other chat group admins or owner receive the muteMember callback.
    // muteDuration: The mute duration. If you pass `-1`, members are muted permanently.
    const options = {
        groupId: "groupId"，
        username: "user",
        muteDuration: 886400000 // The mute duration. Unit: millisecond.
    };
    chatClient.muteGroupMember(options).then(res => console.log(res))

    // The chat group owner and admins can call unmuteGroupMember to remove the specified user from the chat group mute list.
    // The unmuted member and all the other chat group admins or owner receive the unmuteMember callback.
    const options = {
        groupId: "groupId",
        username: "user"
    };
    chatClient.unmuteGroupMember(options).then(res => console.log(res))

    // The chat group owner or admin can call getGroupMutelist to retrieve the chat group mute list.
    const options = {
        groupId: "groupId"
    };
    chatClient.getGroupMutelist(options).then(res => console.log(res))
    ```

    ### Mute and unmute all the chat group members [#mute-and-unmute-all-the-chat-group-members-5]

    The chat group owner and chat group admins can mute or unmute all the chat group members. Once all the members are muted, only those in the chat group allow list can send messages in the chat group.

    Unlike muting a chat group member, this kind of mute does not expire automatically after a certain period and you need to call the `enableSendGroupMsg` method to unmute all members in the chat group.

    Refer to the following sample code to mute and unmute all the chat group members:

    ```javascript
    // The chat group owner or admin can call disableSendGroupMsg to mute all the chat group members.
    // Once all the members are muted, these members receive the muteAllMembers callback.
    const options = {
      groupId: "groupId",
    };
    chatClient.disableSendGroupMsg(options).then((res) => console.log(res));

    // The chat group owner or admin can call enableSendGroupMsg to unmute all the chat group members.
    // Once all the members are unmuted, these members receive the unmuteAllMembers callback.
    const options = {
      groupId: "groupId",
    };
    chatClient.enableSendGroupMsg(options).then((res) => console.log(res));
    ```

    ### Manage the chat group allow list [#manage-the-chat-group-allow-list-6]

    The chat group owner and admins are added to the chat group allow list by default.

    Members in the chat group allow list can send chat group messages even when the chat group owner or admin has muted all chat group members. However, if a member is already in the chat group mute list, this member still cannot send messages in the group even after being added to the allow list.

    Refer to the following sample code to manage the chat group allow list:

    ```javascript
    // The chat group owner or admin can call addUserToAllowlist to add the specified member to the chat group allow list.
    // Once the member is added, all the other chat group admins or owner receive the addUsersToGroupAllowlist callback.
    const options = {
      groupId: "groupId",
      users: ["user1", "user2"],
    };
    chatClient.addUsersToGroupAllowlist(options).then((res) => console.log(res));

    // The chat group owner or admin can call removeAllowlistMember to remove the specified member from the chat group list.
    // Once the member is removed, all the other chat group admins or owner receive the rmUserFromGroupWhiteList callback.
    const options = {
      groupId: "groupId",
      userName: "user",
    };
    chatClient.removeAllowlistMember(options).then((res) => console.log(res));

    // Chat group members can call isInGroupAllowlist to check whether they are in the chat group allow list.
    const option = {
      groupId: "groupId",
      userName: "user",
    };
    chatClient.isInGroupAllowlist(option).then((res) => console.log(res));

    // The chat group owner or admin can call getGroupAllowlist to retrieve the chat group allow list.
    const options = {
      groupId: "groupId",
    };
    chatClient.getGroupAllowlist(options).then((res) => console.log(res));
    ```

    ### Listen for chat group events [#listen-for-chat-group-events-6]

    For details, see [Chat Group Events](./manage-chat-groups#listen-for-chat-group-events).

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>
</_PlatformTabsGroup>
