TencentImSDKPlugin.v2TIMManager.getGroupManager()
core class.getGroupMemberList
(Details) to get the list of members in a specified group. This list contains the profile information of each member, such as user ID (userID
), group name card (nameCard
), profile photo (faceUrl
), nickname (nickName
), and time for joining the group (joinTime
).filter
) and paged pull (nextSeq
) advanced features of the API for pulling the group member list.filter
)getGroupMemberList
API (Details) to specify the filter
to determine whether to pull the list of the information of specified roles.Filter | Type |
GroupMemberFilterTypeEnum.V2TIM_GROUP_MEMBER_FILTER_ALL | Pull the list of the information of all the group members |
GroupMemberFilterTypeEnum.V2TIM_GROUP_MEMBER_FILTER_OWNER | Pull the list of the information of the group owner |
GroupMemberFilterTypeEnum.V2TIM_GROUP_MEMBER_FILTER_ADMIN | Pull the list of the information of the group admin |
GroupMemberFilterTypeEnum.V2TIM_GROUP_MEMBER_FILTER_COMMON | Pull the list of the information of ordinary group members |
// Specify to pull the profile of the group owner through the `filter` parameterconst groupID = "groupID";const count = 10;const filter = GroupMemberFilterTypeEnum.V2TIM_GROUP_MEMBER_FILTER_ADMIN;const offset = 0;const nextSeq = "0";groupManager.getGroupMemberList(groupID, filter, nextSeq, count, offset);
nextSeq
)getGroupMemberList
for the first time, set nextSeq
to 0
(indicating to pull the group member list from the beginning). Up to 50 group member objects can be pulled at a time.V2TIMGroupMemberInfoResult
callback of getGroupMemberList
will contain nextSeq
(field for the next pull):nextSeq
is 0
, all the group members have been pulled.nextSeq
is greater than 0
, there are more group members that can be pulled. This does not mean that the next page of the member list will be pulled immediately. In common communications software, a paged pull is often triggered by a swipe operation.getGroupMemberList
API and pass in the nextSeq
parameter (the value is from the V2TIMGroupMemberInfoResult
object returned by the last pull) for the next pull.nextSeq
is 0
.// Specify to pull the profile of the group owner through the `filter` parameterconst groupID = "groupID";const count = 10;const filter = GroupMemberFilterTypeEnum.V2TIM_GROUP_MEMBER_FILTER_ADMIN;const offset = 0;const nextSeq = "0";groupManager.getGroupMemberList(groupID, filter, nextSeq, count, offset);
muteGroupMember
(Details) to mute a specified group member and set the muting period in seconds. The muting information is stored in the muteUtil
attribute of the group member.onMemberInfoChanged
callback (Details).setGroupInfo
API (Details) to mute the entire group by setting the allMuted
attribute to true
. The entire group can be muted for an unlimited period of time and needs to be unmuted through setAllMuted(false)
of the group profile.onGroupInfoChanged
callback (Details). This feature is disabled by default and can be enabled in the console.
Directions: Go to the Group configuration module in the IM console, select Group system notification configuration, click Edit in the Operation column, and modify Notification of muting all change.
Only the group owner can mute the admin.// Mute the `userB` group member for 10 secondsconst groupID = "groupID";const userID = "userID";const seconds = 10;groupManager.muteGroupMember(groupID, userID, seconds);// Mute all the membersgroupManager.setGroupInfo({isAllMuted: true,groupID: "",groupType: "Public",});TencentImSDKPlugin.v2TIMManager.addGroupListener({onMemberInfoChanged: (groupID, v2TIMGroupMemberChangeInfoList) => {// The group member information is changed.},onGroupInfoChanged: (groupID, info) => {// The group information is changed.},});
kickGroupMember
API (Details) to remove a specified ordinary group member from the group.onMemberKicked
callback (Details).muteGroupMember
(Details) to mute a specified member to implement similar controls. For detailed directions, see muteGroupMember.groupManager.kickGroupMember("groupID", []);
setGroupMemberRole
(Details) to set a group member in a public group (Public) or meeting group (Meeting) as the admin.onGrantAdministrator
callback (Details).onRevokeAdministrator
callback (Details).groupManager.setGroupMemberRole("groupID","userID",GroupMemberRoleTypeEnum.V2TIM_GROUP_MEMBER_ROLE_ADMIN);// Listen for the role changeTencentImSDKPlugin.v2TIMManager.addGroupListener({onMemberInfoChanged: (groupID, v2TIMGroupMemberChangeInfoList) => {},onGroupInfoChanged: (groupID, info) => {},onGrantAdministrator: (groupID, info, infolist) => {},onRevokeAdministrator: (groupID, info, infolist) => {},});
V2TIMGroupChangeInfo
is V2TIMGroupChangeInfo.V2TIM_GROUP_INFO_CHANGE_TYPE_OWNER
and the value is the UserID of the new group owner.groupManager.transferGroupOwner("groupID", "userID");
groupManager.getGroupOnlineMemberCount("groupID");
Was this page helpful?