Browse SDKs · iOS
Platform
SDKsiOS

Mute or unmute the entire group

Enable or disable group-wide mute with OpenIM iOS SDK.

Copy

Invoke changeGroupMute:isMute:onSuccess:onFailure: to enable or disable group-wide muting (typically restricted to group owners and administrators):

Parameters

ParameterTypeRequiredDescription
groupIDNSString *YesTarget group ID.
isMuteBOOLYesPass YES to enable group-wide mute, or NO to disable.

Code example

[[OIMManager manager] changeGroupMute:groupID
                               isMute:YES
                            onSuccess:^(NSString * _Nullable data) {
                                NSLog(@"changeGroupMute success");
                            }
                            onFailure:^(NSInteger code, NSString *message) {
                                NSLog(@"changeGroupMute failed: %ld %@", (long)code, message);
                            }];

Return value

The onSuccess callback returns confirmation when the server accepts the group mute status change.

State changes after the call

  1. Local state update: The client updates the local cached group's status or mute attribute matching groupID. Regular members are prohibited from sending messages, while the group owner and administrators remain unaffected.
  2. Event notification: All members in the group receive an updated OIMGroupInfo object via the onGroupInfoChanged: listener callback.
  3. Re-query calibration: To mute an individual member for a specified duration, refer to Mute or unmute a group member. For listener setup, refer to Groups overview.