getUsersInGroup
Feature Introduction
Description
Find out whether a group of users are in a specified group.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future<dynamic> getUsersInGroup(
String groupID,
List<String> userIDs, {
String? operationID,
})
Input Parameters
参数名称 | 参数类型 | 是否必填 | 描述 |
---|---|---|---|
groupID | String | 是 | 群ID |
userIDs | List< String> | 是 | 用户ID 列表 |
Return Results
参数名称 | 参数类型 | 描述 |
---|---|---|
~ | ~ | 无异常抛出则操作成功 |
Code Example
await OpenIM.iMManager.groupManager.getUsersInGroup(
groupID: '',
userIDs: []
);
// todo
Function Prototype
- (void)getUsersInGroup:(NSString *)groupID
userIDs:(NSArray<NSString *> *)userIDs
onSuccess:(nullable OIMStringArrayCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;
Input Parameters
参数名称 | 参数类型 | 是否必填 | 描述 |
---|---|---|---|
groupID | NSString | 是 | 群ID |
userIDs | NSArray< String> | 是 | 用户ID 列表 |
Return Results
参数名称 | 参数类型 | 描述 |
---|---|---|
onSuccess | OIMSuccessCallback | 成功返回 |
onFailure | OIMFailureCallback | 失败返回 |
Code Example
[OIMManager.manager getUsersInGroup:@""
userIDs: @[]
onSuccess:^(NSString * _Nullable data) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void quitGroup(OnBase<String> callBack, String gid)
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
callBack | OnBase | Yes | Callback interface |
gid | String | Yes | Group ID |
Return Results
Code Example
OpenIMClient.getInstance().groupManager.quitGroup(new OnBase<String>() {
@Override
public void onError(int code, String error) {
}
@Override
public void onSuccess(String data) {
}
});
Function Prototype
IMSDK.getUsersInGroup({
groupID: string;
userIDList: string[];
}, operationID?: string): Promise<WsResponse<string[]>>
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
groupID | string | Yes | Group ID |
userIDList | string[] | Yes | User ID list |
operationID | string | No | Operation ID, which is used to locate the problem. Keep it unique. You are advised to use the current time and random number |
Return Results
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<WsResponse<string[]>> | 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 { OpenIMSDK } from 'open-im-sdk';
// const IMSDK = new OpenIMSDK();
IMSDK.getUsersInGroup({
groupID: 'groupID',
userIDList: ['userIDList'],
})
.then(() => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
IMSDK.asyncApi('getUsersInGroup', operationID: string, {
groupID: string;
userIDList: string[];
}): Promise<string[]>
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
groupID | string | Yes | Group ID |
userIDList | string[] | Yes | User ID list |
operationID | string | Yes | Operation ID, which is used to locate the problem. Keep it unique. You are advised to use the current time and random number |
Return Results
The function is transformed into a Promise using the
openim-uniapp-polyfill
package. When calling, usethen
andcatch
to determine and handle successful and failed callbacks.
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<string[]> | Success callback |
Promise.catch() | Promise<CatchResponse> | Failure callback |
Code Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.asyncApi('getUsersInGroup', IMSDK.uuid(), {
groupID: 'groupID',
userIDList: ['userIDList'],
})
.then(() => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
OpenIMSDKRN.getUsersInGroup({
groupID: string;
userIDList: string[];
}, operationID: string): Promise<string[]>
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
groupID | string | Yes | Group ID |
userIDList | string[] | Yes | User ID list |
operationID | string | Yes | Operation ID, which is used to locate the problem. Keep it unique. You are advised to use the current time and random number |
Return Result
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<string[]> | Callback on successful call |
Promise.catch() | Promise<CatchResponse> | Callback on failed call |
Code Example
import OpenIMSDKRN from "open-im-sdk-rn";
OpenIMSDKRN.quitGroup('groupID', 'operationID')
.then(() => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
public static void GetUsersInGroup(OnBase<string[]> cb, string groupId, string[] userIdList)
Input Parameter
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
cb | OnBase | Yes | Callback |
groupId | string | Yes | Group ID |
userIdList | string[] | Yes | User ID list |
Return Result
Code Example
IMSDK.QuitGroup((suc,errCode,errMsg)=>{
},groupId,{"userId"});