Browse SDKs · Android
Platform
SDKsAndroid

Mute or unmute a group member

Use the Android SDK to set the mute duration for a specified group member.

Copy

Set the mute duration for a specified group member or unmute them. Group owners and administrators can mute a member for a specified number of seconds; passing 0 seconds removes the mute immediately. This setting applies solely to the individual member and operates independently of Mute or unmute a group.

Code example

String groupID = "group_123";
String userID = "user_b";
long seconds = 3600L; // Mute for 1 hour; pass 0L to unmute

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

        @Override
        public void onError(int code, String error) {
            // Failed to update member mute status
        }
    },
    groupID,
    userID,
    seconds
);

Parameters

ParameterTypeRequiredDescription
baseOnBase<String>YesCallback handler for the asynchronous request.
groupIDStringYesGlobally unique ID of the target group.
userIDStringYesUser ID of the target group member.
secondslongYesMute duration in seconds. Pass 0 to unmute the member.

Return value

Upon success, data in onSuccess returns a confirmation message.

State changes after the call

  1. Callback confirmation: The onSuccess callback confirms that the mute status was persisted on the server.
  2. Asynchronous event delivery: Members in the group receive the onGroupMemberInfoChanged event delivering the updated GroupMembersInfo with the new muteEndTime timestamp. The client should merge this state into the cached member record using groupID:userID as the unique key.
  3. Re-query calibration: If mute expiration or state falls out of sync, call Get group member profiles to reload member data.

For complete listener registration and lifecycle management, see Group overview.