changeGroupMute
Feature Introduction
Description
The group owner or group admin changes the mute status of the group.
Note
After being muted, regular members cannot send messages, but the group owner and admins can continue to send messages.
Related Callback: onGroupInfoChanged
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future<dynamic> changeGroupMute({
required String groupID,
required bool mute,
String? operationID,
})
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
groupID | String | Yes | Group ID |
mute | bool | Yes | true: Mute the group |
Return Result
Parameter Name | Parameter Type | Description |
---|---|---|
~ | ~ | If no exception is thrown, the setting is successful |
Code Example
await OpenIM.iMManager.groupManager.changeGroupMute(
groupID: 'groupID',
mute: true,
);
// todo
Function Prototype
- (void)changeGroupMute:(NSString *)groupID
isMute:(BOOL)isMute
onSuccess:(nullable OIMSuccessCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
groupID | NSString | Yes | Group ID |
isMute | BOOL | Yes | Mute status |
Return Result
Parameter Name | Parameter Type | Description |
---|---|---|
onSuccess | OIMSuccessCallback | Successful return |
onFailure | OIMFailureCallback | Failed return |
Code Example
[OIMManager.manager changeGroupMute:@""
isMute:YES
onSuccess:^(NSString * _Nullable data) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void changeGroupMute(OnBase<String> callBack, String gid, boolean mute)
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
callBack | OnBase | Yes | Callback interface |
gid | String | Yes | Group ID |
mute | Boolean | Yes | true for mute, false for unmute |
Return Result
Code Example
OpenIMClient.getInstance().groupManager.changeGroupMute(new OnBase<String>() {
@Override
public void onError(int code, String error) {
}
@Override
public void onSuccess(String data) {
}
},gid,mute)
Function Prototype
IMSDK.changeGroupMute({
groupID: string;
isMute: boolean;
}, operationID?: string): Promise<WsResponse>
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
groupID | string | Yes | Group ID |
isMute | boolean | Yes | Mute status |
Return Result
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<WsResponse> | Successful callback |
Promise.catch() | Promise<WsResponse> | Failed callback |
Code Example
import { getSDK } from '@openim/wasm-client-sdk';
const IMSDK = getSDK();
// use in electron with ffi
// import { getWithRenderProcess } from '@openim/electron-client-sdk/lib/render';
// const { instance: IMSDK } = getWithRenderProcess();
// use in mini program
// import { OpenIMSDK } from 'open-im-sdk';
// const IMSDK = new OpenIMSDK();
IMSDK.changeGroupMute({
groupID: '',
isMute: true,
})
.then(() => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
IMSDK.asyncApi('acceptGroupApplication', operationID: string, {
groupID: string;
fromUserID: string;
handleMsg: string;
}): Promise<void>
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
operationID | string | Yes | Operation ID for issue location. Unique, suggested to use current time combined with a random number |
groupID | string | Yes | Group ID |
fromUserID | string | Yes | Applicant's User ID |
handleMsg | string | Yes | Operation message |
Return Value
The function is promise-based in the
openim-uniapp-polyfill
package. Usethen
andcatch
to handle successful and failed callbacks.
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<void> | Successful callback |
Promise.catch() | Promise<CatchResponse> | Failure callback |
Code Sample
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.asyncApi('acceptGroupApplication', IMSDK.uuid(), {
groupID: '',
fromUserID: '',
handleMsg: '',
})
.then(() => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
OpenIMSDKRN.changeGroupMute({
groupID: string,
isMute: boolean,
}, operationID: string): Promise<void>
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
groupID | string | Yes | Group ID |
isMute | boolean | Yes | Mute status |
operationID | string | Yes | Operation ID, used for problem location, keep unique, suggest using current time and random number |
Return Result
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<void> | Callback on successful call |
Promise.catch() | Promise<CatchResponse> | Callback on failed call |
Code Example
import OpenIMSDKRN from "open-im-sdk-rn";
OpenIMSDKRN.changeGroupMute({
groupID: '',
isMute: true,
}, 'operationID')
.then(() => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
public static void ChangeGroupMute(OnBase<bool> cb, string groupId, bool isMute)
Input Parameter
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
cb | onBase | Yes | Callback |
groupID | string | Yes | Group ID |
isMute | bool | Yes | Mute status |
Return Result
Code Example
IMSDK.ChangeGroupMute((suc,errCode,errMsg)=>{
},groupId,isMute);