Browse SDKs · iOS
Platform
SDKsiOS

Mute or unmute a group member

Mute or unmute an iOS group member.

Copy

Invoke changeGroupMemberMute:userID:mutedSeconds:onSuccess:onFailure: to mute or unmute a specified group member for a given duration (restricted to group owners and administrators):

Parameters

ParameterTypeRequiredDescription
groupIDNSString *YesTarget group ID.
userIDNSString *YesTarget member user ID.
mutedSecondsNSIntegerYesDuration of mute in seconds. Pass 0 to unmute the member.

Code example

[[OIMManager manager] changeGroupMemberMute:@"group_1001"
                                     userID:@"user_003"
                               mutedSeconds:3600
                                  onSuccess:^(NSString * _Nullable data) {
                                      NSLog(@"changeGroupMemberMute success");
                                  }
                                  onFailure:^(NSInteger code, NSString *message) {
                                      NSLog(@"changeGroupMemberMute failed: %ld %@", (long)code, message);
                                  }];

Return value

The onSuccess callback returns confirmation when the server accepts the mute configuration.

State changes after the call

  1. Local state update: The member model's muteEndTime property is updated to reflect the Unix timestamp when muting expires.
  2. Event notification: Updated member details broadcast across active client sessions through onGroupMemberInfoChanged:. The client merges state using groupID:userID.
  3. Re-query calibration: To mute all regular members in the group simultaneously, refer to Mute or unmute the entire group. For member queries, refer to Group member queries overview.