dismissGroup
Feature Introduction
Description
Disband the group; only the group owner can call this.
Note
The group status field will be set to "disbanded" in the background. When group members fetch the list of groups they've joined, this group will no longer be returned.
Relevant callbacks: onGroupDismissed
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future<dynamic> dismissGroup({
required String groupID,
String? operationID,
})
Input Parameters
| Parameter Name | Data Type | Mandatory | Description |
|---|---|---|---|
| groupID | String | Yes | Group ID |
Return Result
| Parameter Name | Data Type | Description |
|---|---|---|
| ~ | ~ | Operation is successful if no exceptions are thrown |
Code Example
await OpenIM.iMManager.groupManager.dismissGroup(
groupID: 'groupID',
);
// todo
Function Prototype
- (void)dismissGroup:(NSString *)groupID
onSuccess:(nullable OIMSuccessCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;
Input Parameters
| Parameter Name | Data Type | Mandatory | Description |
|---|---|---|---|
| groupID | NSString | Yes | Group ID |
Return Result
| Parameter Name | Data Type | Description |
|---|---|---|
| onSuccess | OIMSuccessCallback | Success return |
| onFailure | OIMFailureCallback | Failure return |
Code Example
[OIMManager.manager dismissGroup:@""
onSuccess:^(NSString * _Nullable data) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void dismissGroup(OnBase<String> callBack, String gid)
Input Parameters
| Parameter Name | Data Type | Mandatory | Description |
|---|---|---|---|
| callBack | OnBase | Yes | Callback interface |
| gid | String | Yes | Group ID |
Return Result
Code Example
OpenIMClient.getInstance().groupManager.dismissGroup(new OnBase<String>() {
@Override
public void onError(int code, String error) {
}
@Override
public void onSuccess(String data) {
}
},gid);
Function Prototype
IMSDK.dismissGroup(groupID: string, operationID?: string): Promise<WsResponse>
Input Parameters
| Parameter Name | Data Type | Mandatory | Description |
|---|---|---|---|
| groupID | string | Yes | Group ID |
Return Result
| Parameter Name | Data Type | Description |
|---|---|---|
| Promise.then() | Promise<WsResponse> | Success callback |
| Promise.catch() | Promise<WsResponse> | Failure 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 { getSDK } from '@openim/client-sdk';
// const IMSDK = getSDK();
IMSDK.dismissGroup('groupID')
.then(() => {
// Call was successful
})
.catch(({ errCode, errMsg }) => {
// Call failed
});
Function Prototype
IMSDK.asyncApi('dismissGroup', operationID: string, groupID: string): Promise<void>
Input Parameters
| Parameter Name | Data Type | Mandatory | Description |
|---|---|---|---|
| operationID | string | Yes | Operation ID, used for troubleshooting. Keep it unique, suggested to use the current time and a random number. |
| groupID | string | Yes | Group ID |
Return Result
With the
openim-uniapp-polyfillpackage, the function is made Promise-based. When calling, usethenandcatchto determine and handle success and failure callbacks respectively.
| Parameter Name | Data Type | Description |
|---|---|---|
| Promise.then() | Promise<void> | Successful callback |
| Promise.catch() | Promise<CatchResponse> | Failure callback |
Code Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.asyncApi('dismissGroup', IMSDK.uuid(), 'groupID')
.then(() => {
// Call was successful
})
.catch(({ errCode, errMsg }) => {
// Call failed
});
Function Prototype
OpenIMSDKRN.dismissGroup(groupID: string, operationID: string): Promise<void>
Input Parameters
| Parameter Name | Parameter Type | Mandatory | Description |
|---|---|---|---|
| groupID | string | Yes | Group ID |
| 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.dismissGroup('groupID', 'operationID')
.then(() => {
// Call was successful
})
.catch(({ errCode, errMsg }) => {
// Call failed
});