SDKsiOS
Mute or unmute a group member
Mute or unmute an iOS group member.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
groupID | NSString * | Yes | Target group ID. |
userID | NSString * | Yes | Target member user ID. |
mutedSeconds | NSInteger | Yes | Duration 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
- Local state update: The member model's
muteEndTimeproperty is updated to reflect the Unix timestamp when muting expires. - Event notification: Updated member details broadcast across active client sessions through
onGroupMemberInfoChanged:. The client merges state usinggroupID:userID. - 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.
Was this page helpful?