getSpecifiedGroupMembersInfo
Feature Introduction
Note
Retrieve information of specified group members.
Warning
(1) The caller must be a member of the group to call this function. (2) It is recommended to limit the member list to a maximum of 10,000 at a time.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future<List<GroupMembersInfo>> getGroupMembersInfo({
required String groupID,
required List<String> userIDList,
String? operationID,
})
Input Parameters
Parameter Name | Data Type | Required | Description |
---|---|---|---|
groupID | String | Yes | Group ID |
userIDList | List<String> | Yes | Member ID List |
Return Values
Parameter Name | Data Type | Description |
---|---|---|
~ | List<GroupMembersInfo> | Successful Return |
Code Example
List<GroupMembersInfo> list = await OpenIM.iMManager.groupManager.getGroupMembersInfo(
groupID: 'groupID',
userIDList: ['1129'],
);
// todo
Function Prototype
- (void)getSpecifiedGroupMembersInfo:(NSString *)groupID
usersID:(NSArray <NSString *> *)usersID
onSuccess:(nullable OIMGroupMembersInfoCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;
Input Parameters
Parameter Name | Data Type | Required | Description |
---|---|---|---|
groupID | NSString | Yes | Group ID |
usersID | NSArray <NSString*> | Yes | Member ID List |
Return Values
Parameter Name | Data Type | Description |
---|---|---|
onSuccess | NSArray< OIMGroupMemberInfo *> | Successful Return |
onFailure | OIMFailureCallback | Failed Return |
Code Example
[OIMManager.manager getSpecifiedGroupMembersInfo:@""
usersID:@[]
onSuccess:^(NSArray<OIMGroupMemberInfo *> * _Nullable groupMembersInfo) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void getGroupMembersInfo(OnBase<List<GroupMembersInfo>> callBack, String groupId, List<String> uidList)
Input Parameters
Parameter Name | Data Type | Required | Description |
---|---|---|---|
callBack | OnBase<List<GroupMembersInfo>> | Yes | Callback Interface |
groupId | String | Yes | Group ID |
uidList | List<String> | Yes | Member ID List |
Return Values
Code Example
OpenIMClient.getInstance().groupManager.getGroupMembersInfo(new OnBase<List<GroupMembersInfo>>() {
@Override
public void onError(int code, String error) {
}
@Override
public void onSuccess(List<GroupMembersInfo> data) {
}
},groupId,uidList)
Function Prototype
IMSDK.getSpecifiedGroupMembersInfo({
groupID: string;
userIDList: string[];
}, operationID?: string): Promise<WsResponse<GroupMemberItem[]>>
Input Parameters
Parameter Name | Data Type | Required | Description |
---|---|---|---|
groupID | string | Yes | Group ID |
userIDList | string[] | Yes | Member ID List |
Return Values
Parameter Name | Data Type | Description |
---|---|---|
Promise.then() | Promise<WsResponse<GroupMemberItem[]>> | Group Members List |
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.getSpecifiedGroupMembersInfo({
groupID: '',
userIDList: ['userID'],
})
.then(({ data }) => {
// Call Successful
})
.catch(({ errCode, errMsg }) => {
// Call Failed
});
Function Prototype
IMSDK.asyncApi('getSpecifiedGroupMembersInfo', operationID: string, {
groupID: string;
userIDList: string[];
}): Promise<GroupMemberItem[]>
Input Parameters
Parameter Name | Data Type | Required | Description |
---|---|---|---|
operationID | string | Yes | Operation ID, for troubleshooting, unique. Recommended to use the current time and a random number |
groupID | string | Yes | Group ID |
userIDList | string[] | Yes | List of group member IDs |
Return Values
The function is made into a Promise through the
openim-uniapp-polyfill
package. When calling, usethen
andcatch
to judge and handle successful and failed callbacks.
Parameter Name | Data Type | Description |
---|---|---|
Promise.then() | Promise<GroupMemberItem[]> | Group Members List |
Promise.catch() | Promise<CatchResponse> | Failed Callback |
Code Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.asyncApi('getSpecifiedGroupMembersInfo', IMSDK.uuid(), {
groupID: '',
userIDList: ['userID'],
})
.then((data) => {
// Call Successful
})
.catch(({ errCode, errMsg }) => {
// Call Failed
});
Function Prototype
OpenIMSDKRN.getSpecifiedGroupMembersInfo({
groupID: string,
userIDList: string[],
}, operationID: string): Promise<GroupMemberItem[]>
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
groupID | string | Yes | Group ID |
userIDList | string[] | Yes | List of group member IDs |
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<GroupMemberItem[]> | Group memberlist |
Promise.catch() | Promise<CatchResponse> | Callback on failed call |
Code Example
import OpenIMSDKRN from "open-im-sdk-rn";
OpenIMSDKRN.getSpecifiedGroupMembersInfo({
groupID: '',
userIDList: ['userID'],
}, 'operationID')
.then((data) => {
// Call Successful
})
.catch(({ errCode, errMsg }) => {
// Call Failed
});
Function Prototype
public static void GetSpecifiedGroupMembersInfo(OnBase<List<GroupMember>> cb, string groupId, string[] userIdList)
Input Parameter
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
cb | OnBase<List<GroupMembersInfo>> | Yes | Callback |
groupId | String | Yes | Group ID |
userIDList | string[] | Yes | Array of group member IDs |
Return Result
Code Example
IMSDK.GetSpecifiedGroupMembersInfo((list,errCode,errMsg)=>{
},groupId,userIdList);