getGroupMemberList
Introduction
Load the list of members from the group.
You could get the group member list with this method, it will provide the profile information of the group members.
This method supports both filter and paging, as their maybe numerous members in the group.
filter and nextSeq will not work on Web, while count and offset is required.
The special limit for the AVChatRoom: Do not supports the request for different member types, and the upper limit for the count is 31, new entry members has the priority. User will exist the group after turning off the APP, and should re-enter the group after backing to APP, otherwise a error code of 10007 will be returned.
Parameter details
Parameter name | Parameter type | Required | Description |
---|---|---|---|
groupID | string | yes | The group ID. |
filter | GroupMemberFilterTypeEnum | yes | Filtered with the type parameter of the group member. |
nextSeq | string | yes | The sequence number used for requesting in pages, while it is "0" in the first iteration. Indicating needs to request for the next page if the nextSeq not null in callback. |
count | number | no | Not works temporarily. |
offset | number | no | The offset, 0 in default. |
Returned template
V2TimValueCallback<V2TimGroupMemberInfoResult>
{
code : number
desc : string
data : {
memberInfoList : V2TimGroupMemberFullInfo[]
nextSeq : string // The sequence number used for the next request iteration.
}
}
Return value details
name | type | description |
---|---|---|
code | number | Request result: Error codes. 0 means success. |
desc | string | The description of the error. It will be empty if success. |
data | V2TimGroupMemberInfoResult | The list of members of the group obtained. |
Code example
import {
TencentImSDKPlugin,
GroupMemberFilterTypeEnum,
} from 'react-native-tim-js';
const getGroupMemberListRes = await TencentImSDKPlugin.v2TIMManager
.getGroupManager()
.getGroupMemberList(
'groupID',
GroupMemberFilterTypeEnum.V2TIM_GROUP_MEMBER_FILTER_ADMIN,
'0',
100,
0
);
if (getGroupMemberListRes.code == 0) {
getGroupMemberListRes.data?.memberInfoList?.forEach((element) => {
element?.customInfo;
element?.faceUrl;
element?.friendRemark;
element?.joinTime;
element?.muteUntil;
element?.nameCard;
element?.nickName;
element?.role;
element?.userID;
});
}