getUsersInGroup
Description
info
Check if a batch of users is 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
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| groupID | String | Yes | Group ID |
| userIDs | List< String> | Yes | User ID List |
Return Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| ~ | ~ | Operation successful if no exception thrown |
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
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| groupID | NSString | Yes | Group ID |
| userIDs | NSArray< String> | Yes | User ID List |
Return Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| onSuccess | OIMSuccessCallback | Success |
| onFailure | OIMFailureCallback | Failure |
Code Example
[OIMManager.manager getUsersInGroup:@""
userIDs: @[]
onSuccess:^(NSString * _Nullable data) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void getUsersInGroup(OnBase<String[]> callBack, String groupId, String[] userIdList)
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| callBack | OnBase | Yes | Callback interface |
| groupID | string | Yes | Group ID |
| userIDList | string[] | Yes | User ID List |
Return Result
Code Example
OpenIMClient.getInstance().groupManager.getUsersInGroup(new OnBase<String>() {
@Override
public void onError(int code, String error) {
}
@Override
public void onSuccess(String[] data) {
}
},gid);
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, used to pinpoint issues, keep unique, prefer time+random |
Return Result
| 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 { getSDK } from '@openim/client-sdk';
// const IMSDK = getSDK();
IMSDK.getUsersInGroup({
groupID: 'groupID',
userIDList: ['userIDList'],
})
.then(() => {
// Success
})
.catch(({ errCode, errMsg }) => {
// Failure
});
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, used to pinpoint issues, keep unique, prefer time+random |
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<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(() => {
// Success
})
.catch(({ errCode, errMsg }) => {
// Failure
});
Function Prototype
OpenIMSDK.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 | No | Operation ID, used to pinpoint issues, keep unique, prefer time+random |
Return Result
| Parameter Name | Parameter Type | Description |
|---|---|---|
| Promise.then() | Promise<string[]> | Success callback |
| Promise.catch() | Promise<OpenIMApiError> | Failure callback |
Code Example
import OpenIMSDK from "@openim/rn-client-sdk";
OpenIMSDK.getUsersInGroup({
groupID: 'groupID',
userIDList: ['userIDList'],
})
.then(() => {
// Success
})
.catch((error) => {
// Failure
});
Function Prototype
public static void GetUsersInGroup(OnBase<string[]> cb, string groupId, string[] userIdList)
Input Parameters
| Parameter Name | Parameter Type | Required | Description |
|---|---|---|---|
| cb | OnBase | Yes | Callback |
| groupId | string | Yes | Group ID |
| userIdList | string[] | Yes | User ID List |
Return Result
Code Example
IMSDK.GetUsersInGroup((suc,errCode,errMsg)=>{
},groupId,new string[]{"userId"});