kickGroupMember
Description
info
Remove group members from the group.
Note
(1) The group owner and group administrators can remove ordinary members; the group owner can remove administrators and ordinary members.
Related Callbacks:
onJoinedGroupDeleted
onGroupMemberDeleted
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future<List<GroupInviteResult>> kickGroupMember({
required String groupID,
required List<String> userIDList,
String? reason,
String? operationID,
})
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| groupID | String | Yes | Group ID |
| reason | Sting | No | Kick reason |
| userIDList | List<String> | Yes | List of User IDs to kick |
Return Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| ~ | GroupInviteResult | Success |
GroupInviteResult
| Field Name | Field Type | Description |
|---|---|---|
| userID | String | User ID |
| result | Int | Result |
Code Example
List<GroupInviteResult> list = await OpenIM.iMManager.groupManager.kickGroupMember(
groupID: 'groupID',
userIDList: [],
reason: ''
);
// todo
Function Prototype
- (void)kickGroupMember:(NSString *)groupID
reason:(NSString * _Nullable)reason
uids:(NSArray *)usersID
onSuccess:(nullable OIMSimpleResultsCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| groupID | NSString | Yes | Group ID |
| reason | NSSting | No | Kick reason |
| usersID | NSArray<NSString *> | Yes | List of User IDs to kick |
Return Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| onSuccess | OIMSimpleResultInfo | Success |
| onFailure | OIMFailureCallback | Failure |
OIMSimpleResultInfo
| Field Name | Field Type | Description |
|---|---|---|
| userID | NSString | User ID |
| result | NSInteger | Result |
Code Example
[OIMManager.manager kickGroupMember:@""
reason:@""
uids:@[@""]
onSuccess:^(NSArray<OIMSimpleResultInfo *> * _Nullable results) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void kickGroupMember(OnBase<List<GroupInviteResult>> base, String groupId, List<String> uidList, String reason)
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| callBack | OnBase<List<ResultInfo>> | Yes | Callback interface |
| groupId | String | Yes | Group ID |
| reason | Sting | No | Kick reason |
| uidList | List<String> | Yes | List of User IDs to kick |
Return Result
Code Example
OpenIMClient.getInstance().groupManager.kickGroupMember(new OnBase<List<ResultInfo>>() {
@Override
public void onError(int code, String error) {
}
@Override
public void onSuccess(List<GroupInviteResult> data) {
}
}, groupId, uidList, reason)
Function Prototype
IMSDK.kickGroupMember({
groupID: string;
reason: string;
userIDList: string[];
}, operationID?: string): Promise<WsResponse>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| groupID | string | Yes | Group ID |
| reason | string | Yes | Kick reason |
| userIDList | string[] | Yes | List of User IDs to kick |
Return Result
| Parameter Name | Parameter 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.kickGroupMember({
groupID: '',
reason: '',
userIDList: ['userID'],
})
.then(() => {
// Success
})
.catch(({ errCode, errMsg }) => {
// Failure
});
Function Prototype
IMSDK.asyncApi('kickGroupMember', operationID: string, {
groupID: string;
reason: string;
userIDList: string[];
}): Promise<void>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| operationID | string | Yes | Operation ID, used to pinpoint issues, keep unique, prefer time+random |
| groupID | string | Yes | Group ID |
| reason | string | Yes | Kick reason |
| userIDList | string[] | Yes | List of User IDs to kick |
Return Result
Use the
openim-uniapp-polyfillpackage to make the function Promise. When calling, you need to usethenandcatchto determine and handle success and failure callbacks.
| Parameter Name | Parameter Type | Description |
|---|---|---|
| Promise.then() | Promise<void> | Success callback |
| Promise.catch() | Promise<CatchResponse> | Failure callback |
Code Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.asyncApi('kickGroupMember', IMSDK.uuid(), {
groupID: '',
reason: '',
userIDList: ['userID'],
})
.then(() => {
// Success
})
.catch(({ errCode, errMsg }) => {
// Failure
});
Function Prototype
OpenIMSDK.kickGroupMember({
groupID: string,
reason: string,
userIDList: string[],
}, operationID?: string): Promise<void>
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| groupID | string | Yes | Group ID |
| reason | string | Yes | Kick reason |
| userIDList | string[] | Yes | List of User IDs to kick |
| operationID | string | No | Operation ID, used to pinpoint issues, keep unique, prefer time+random |
Return Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| Promise.then() | Promise<void> | Success callback |
| Promise.catch() | Promise<OpenIMApiError> | Failure callback |
Code Example
import OpenIMSDK from "@openim/rn-client-sdk";
OpenIMSDK.kickGroupMember({
groupID: '',
reason: '',
userIDList: ['userID'],
})
.then(() => {
// Success
})
.catch((error) => {
// Failure
});
Function Prototype
public static void KickGroupMember(OnBase<bool> cb, string groupId, string reason, string[] userIdList)
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| cb | OnBase | Yes | Callback interface |
| groupId | string | Yes | Group ID |
| reason | string | No | Kick reason |
| userIdList | string[] | Yes | List of User IDs to kick |
Return Result
Code Example
IMSDK.KickGroupMember((suc,errCode,errMsg)=>{
}, groupId, uidList, reason)