TencentImSDKPlugin.v2TIMManager.getGroupManager()
core class.getGroupMemberList
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 pulling by page (nextSeq
).filter
)getGroupMemberList
API, you can specify filter
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 information list of ordinary group members |
// Use the `filter` parameter to specify only the profile of the group owner is to be pulledgroupManager.getGroupMemberList(count: 10,filter: GroupMemberFilterTypeEnum.V2TIM_GROUP_MEMBER_FILTER_ADMIN,nextSeq: '0',offset: 0,groupID: "",);
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.group_get_memeber_info_list_result_next_seq
is greater than 0
, there are more group members that can be pulled. This doesn't 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
.// Use the `filter` parameter to specify only the profile of the group owner is to be pulledgroupManager.getGroupMemberList(count: 10,filter: GroupMemberFilterTypeEnum.V2TIM_GROUP_MEMBER_FILTER_ADMIN,nextSeq: '0',offset: 0,groupID: "",);
muteGroupMember
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.setGroupInfo
API 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. 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.// Mute the group member `userB` for ten minutesgroupManager.muteGroupMember(groupID: '',userID: 'userB',seconds: 10);// Mute all membersgroupManager.setGroupInfo(info: V2TimGroupInfo(isAllMuted: true,groupID: '',groupType: 'Public'));TencentImSDKPlugin.v2TIMManager.addGroupListener(listener: V2TimGroupListener(onMemberInfoChanged: (groupID, v2TIMGroupMemberChangeInfoList) {// The group member information is changed.},onGroupInfoChanged: (groupID,info){// Group profile modification}));
kickGroupMember
API to remove a specified ordinary group member from the group.onMemberKicked
callback.muteGroupMember
to mute a specified member to implement similar controls. For detailed directions, see muteGroupMember.groupManager.kickGroupMember(groupID: '',memberList: []);
setGroupMemberRole
to set a group member in a public group (Public) or meeting group (Meeting) as the admin.onGrantAdministrator
callback.onRevokeAdministrator
callback.groupManager.setGroupMemberRole(groupID: '',userID: '',role: GroupMemberRoleTypeEnum.V2TIM_GROUP_MEMBER_ROLE_ADMIN);// Listen for the role changeTencentImSDKPlugin.v2TIMManager.addGroupListener(listener: V2TimGroupListener(onMemberInfoChanged: (groupID, v2TIMGroupMemberChangeInfoList) {},onGroupInfoChanged: (groupID,info){},onGrantAdministrator: (String groupID, V2TimGroupMemberInfo info, List<V2TimGroupMemberInfo> infolist){},onRevokeAdministrator: (String groupID, V2TimGroupMemberInfo info, List<V2TimGroupMemberInfo> infolist){},));
onGroupInfoChanged
callback. Here, the type
of V2TIMGroupChangeInfo
is V2TIMGroupChangeInfo.V2TIM_GROUP_INFO_CHANGE_TYPE_OWNER
, and the value is the UserID
of the new group owner.groupManager.transferGroupOwner(groupID: "", userID: "userID");
groupManager.getGroupOnlineMemberCount(groupID: '');
Was this page helpful?