Browse SDKs · Android
Platform
SDKsAndroid

Mute or unmute a group

Enable or disable group-wide mute mode using changeGroupMute().

Copy

Enable or disable mute mode for the entire group. This operation is typically restricted to group owners and administrators. When group-wide mute is enabled, regular members cannot post messages, while owners and administrators can continue chatting. To mute an individual member instead, see Mute or unmute a group member.

Code example

String groupID = "group_123";
boolean isMute = true; // true to mute all members, false to unmute

OpenIMClient.getInstance().groupManager.changeGroupMute(
    new OnBase<String>() {
        @Override
        public void onSuccess(String data) {
            // Group mute status updated successfully
        }

        @Override
        public void onError(int code, String error) {
            // Handle failure
        }
    },
    groupID,
    isMute
);

Parameters

ParameterTypeRequiredDescription
baseOnBase<String>YesCallback delivering the asynchronous operation result.
groupIDStringYesTarget group ID.
isMutebooleanYesPass true to mute all regular members, or false to unmute the group.

Return value

The successful callback confirms that the mute setting was updated on the server.

State changes after the call

A successful callback confirms that the server updated group-wide mute configuration. Group members subsequently receive the onGroupInfoChanged(GroupInfo group) event via OnGroupListener. Inspect the updated status mute flag, merge group state using groupID, and enable or disable the chat input bar accordingly. For complete listener registration details, see Group overview.