getGroupMemberList
Feature Introduction
Description
Retrieve member information of a specified group.
Note
(1) The caller must be a member of this group to call. (2) Since it is fetched from the APP locally, it is recommended to retrieve a maximum of 10,000 at once.
- iOS
- Android
- Flutter
- uni-app
- Browser/Electron/MiniProgram
- React-Native
- Unity
Function Prototype
Future<List<GroupMembersInfo>> getGroupMemberList({
required String groupID,
int filter = 0,
int offset = 0,
int count = 0,
String? operationID,
})
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
groupID | String | Yes | Group ID |
filter | int | Yes | Member filter: 0 for all, 1 for group owner, 2 for admin, 3 for regular member, 4 for admin + regular member, 5 for owner + admin |
offset | int | Yes | Starting offset |
count | int | Yes | Number of members |
Return Result
Parameter Name | Parameter Type | Description |
---|---|---|
~ | List<GroupMemberInfo> | Successful return |
Code Example
List<GroupMembersInfo> list = await OpenIM.iMManager.groupManager.getGroupMemberList(
groupID: 'groupID',
);
// todo
Function Prototype
- (void)getGroupMemberList:(NSString *)groupID
filter:(OIMGroupMemberFilter)filter
offset:(NSInteger)offset
count:(NSInteger)count
onSuccess:(nullable OIMGroupMembersInfoCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
groupID | NSString | Yes | Group ID |
filter | OIMGroupMemberFilter | Yes | Member role |
offset | NSInteger | Yes | Starting offset |
count | NSInteger | Yes | Number of members |
Return Result
Parameter Name | Parameter Type | Description |
---|---|---|
onSuccess | NSArray< OIMGroupMemberInfo *> | Successful return |
onFailure | OIMFailureCallback | Failed return |
Code Example
[OIMManager.manager getGroupMemberList:@""
filter:0
offset:0
count:20
onSuccess:^(NSArray<OIMGroupMemberInfo *> * _Nullable groupMembersInfo) {
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
}];
Function Prototype
public void getGroupMemberList(OnBase<List<GroupMembersInfo>> callBack, String groupId, int filter, int offset, int count)
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
callBack | OnBase<List<GroupMembersInfo>> | Yes | Callback interface |
groupId | String | Yes | Group ID |
filter | int | No | Member filter |
offset | int | Yes | Offset |
count | int | Yes | Number per page |
Return Result
Code Example
OpenIMClient.getInstance().groupManager.getGroupMemberList(new OnBase<List<GroupMembersInfo>>() {
@Override
public void onError(int code, String error) {
}
@Override
public void onSuccess(List<GroupMembersInfo> data) {
}
}, groupId, filter, offset, count);
Function Prototype
IMSDK.getGroupMemberList({
groupID: string;
filter: GroupMemberFilter;
offset: number;
count: number;
}, operationID?: string): Promise<WsResponse<GroupMemberItem[]>>
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
groupID | string | Yes | Group ID |
filter | GroupMemberFilter | Yes | Member role |
offset | number | Yes | Starting offset for pagination |
count | number | Yes | Number of members per page |
Return Result
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<WsResponse<GroupMemberItem[]>> | Member 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 { getSDK } from '@openim/client-sdk';
// const IMSDK = getSDK();
IMSDK.getGroupMemberList({
groupID: '',
filter: 0,
offset: 0,
count: 20,
})
.then(({ data }) => {
// Successful call
})
.catch(({ errCode, errMsg }) => {
// Failed call
});
Function Prototype
IMSDK.asyncApi("getGroupMemberList", operationID: string,
{
groupID: string;
filter: GroupMemberFilter;
offset: number;
count: number;
}
): Promise<GroupMemberItem[]>
Input Parameters
Parameter Name | Parameter Type | Required | Description |
---|---|---|---|
operationID | string | Yes | Operation ID, used for troubleshooting, should be unique. It's recommended to use the current time and a random number. |
groupID | string | Yes | Group ID |
filter | GroupMemberFilter | Yes | Group member role |
offset | number | Yes | Starting offset, used for pagination |
count | number | Yes | Number of members per page |
Return Results
The function is made into a Promise using the
openim-uniapp-polyfill
package. When calling, you need to usethen
andcatch
to determine and handle successful and failed callbacks respectively.
Parameter Name | Parameter Type | Description |
---|---|---|
Promise.then() | Promise<GroupMemberItem[]> | List of members |
Promise.catch() | Promise<CatchResponse> | Failed callback |
Code Example
import IMSDK from 'openim-uniapp-polyfill';
IMSDK.asyncApi('getGroupMemberList', IMSDK.uuid(), {
groupID: '',
filter: 0,
offset: 0,
count: 20,
})
.then((data) => {
// Successfully called
})
.catch(({ errCode, errMsg }) => {
// Failed to call
});
Function Prototype
OpenIMSDKRN.getGroupMemberList({
groupID: string,
filter: GroupMemberFilter,
offset: number,
count: number,
}, operationID: string): Promise<GroupMemberItem[]>
Input Parameters
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
groupID | string | Yes | Group ID |
filter | GroupMemberFilter | Yes | Group member role |
offset | number | Yes | Starting offset, used for pagination |
count | number | Yes | Number of members per page |
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 member list |
Promise.catch() | Promise<CatchResponse> | Callback on failed call |
Code Example
import OpenIMSDKRN from "open-im-sdk-rn";
OpenIMSDKRN.getGroupMemberList({
groupID: '',
filter: 0,
offset: 0,
count: 20,
}, 'operationID')
.then((data) => {
// Successfully called
})
.catch(({ errCode, errMsg }) => {
// Failed to call
});
Function Prototype
public static void GetGroupMemberList(OnBase<List<GroupMember>> cb, string groupId, GroupMemberFilter filter, int offset, int count)
Input Parameter
Parameter Name | Parameter Type | Mandatory | Description |
---|---|---|---|
cb | OnBase<List<GroupMembersInfo>> | Yes | Callback |
groupId | string | Yes | Group ID |
filter | GroupMemberFilter | Yes | Group member role |
offset | int | Yes | Starting offset, used for pagination |
count | int | Yes | Number of members per page |
Return Result
Code Example
IMSDK.GetGroupMemberList((list,errCode,errMsg)=>{
}, groupId, filter, offset, count);