IMSDK
IM features a comprehensive suite of solutions including global access, one-to-one chat, group chat, message push, profile and relationship chain hosting, and account authentication. It also provides complete app access and backend management APIs.
V2TIMGroupManagerabstract

Detailed Description

Advanced group APIs, including APIs for advanced group features such as group member invitation and group joining request

Public Member Functions

virtual ~V2TIMGroupManager ()
 
virtual void CreateGroup (const V2TIMGroupInfo &info, const V2TIMCreateGroupMemberInfoVector &memberList, V2TIMValueCallback< V2TIMString > *callback)=0
 
virtual void GetJoinedGroupList (V2TIMValueCallback< V2TIMGroupInfoVector > *callback)=0
 
virtual void GetGroupsInfo (const V2TIMStringVector &groupIDList, V2TIMValueCallback< V2TIMGroupInfoResultVector > *callback)=0
 
virtual void SearchGroups (const V2TIMGroupSearchParam &searchParam, V2TIMValueCallback< V2TIMGroupInfoVector > *callback)=0
 
virtual void SetGroupInfo (const V2TIMGroupInfo &info, V2TIMCallback *callback)=0
 
virtual void InitGroupAttributes (const V2TIMString &groupID, const V2TIMGroupAttributeMap &attributes, V2TIMCallback *callback)=0
 
virtual void SetGroupAttributes (const V2TIMString &groupID, const V2TIMGroupAttributeMap &attributes, V2TIMCallback *callback)=0
 
virtual void DeleteGroupAttributes (const V2TIMString &groupID, const V2TIMStringVector &keys, V2TIMCallback *callback)=0
 
virtual void GetGroupAttributes (const V2TIMString &groupID, const V2TIMStringVector &keys, V2TIMValueCallback< V2TIMGroupAttributeMap > *callback)=0
 
virtual void GetGroupOnlineMemberCount (const V2TIMString &groupID, V2TIMValueCallback< uint32_t > *callback)=0
 
virtual void SetGroupCounters (const V2TIMString &groupID, const V2TIMStringToInt64Map &counters, V2TIMValueCallback< V2TIMStringToInt64Map > *callback)=0
 
virtual void GetGroupCounters (const V2TIMString &groupID, const V2TIMStringVector &keys, V2TIMValueCallback< V2TIMStringToInt64Map > *callback)=0
 
virtual void IncreaseGroupCounter (const V2TIMString &groupID, const V2TIMString &key, int64_t value, V2TIMValueCallback< V2TIMStringToInt64Map > *callback)=0
 
virtual void DecreaseGroupCounter (const V2TIMString &groupID, const V2TIMString &key, int64_t value, V2TIMValueCallback< V2TIMStringToInt64Map > *callback)=0
 
virtual void GetGroupMemberList (const V2TIMString &groupID, uint32_t filter, uint64_t nextSeq, V2TIMValueCallback< V2TIMGroupMemberInfoResult > *callback)=0
 
virtual void GetGroupMembersInfo (const V2TIMString &groupID, V2TIMStringVector memberList, V2TIMValueCallback< V2TIMGroupMemberFullInfoVector > *callback)=0
 
virtual void SearchGroupMembers (const V2TIMGroupMemberSearchParam &param, V2TIMValueCallback< V2TIMGroupSearchGroupMembersMap > *callback)=0
 
virtual void SetGroupMemberInfo (const V2TIMString &groupID, const V2TIMGroupMemberFullInfo &info, V2TIMCallback *callback)=0
 
virtual void MuteGroupMember (const V2TIMString &groupID, const V2TIMString &userID, uint32_t seconds, V2TIMCallback *callback)=0
 
virtual void InviteUserToGroup (const V2TIMString &groupID, const V2TIMStringVector &userList, V2TIMValueCallback< V2TIMGroupMemberOperationResultVector > *callback)=0
 
virtual void KickGroupMember (const V2TIMString &groupID, const V2TIMStringVector &memberList, const V2TIMString &reason, uint32_t duration, V2TIMValueCallback< V2TIMGroupMemberOperationResultVector > *callback)=0
 
virtual void SetGroupMemberRole (const V2TIMString &groupID, const V2TIMString &userID, uint32_t role, V2TIMCallback *callback)=0
 
virtual void MarkGroupMemberList (const V2TIMString &groupID, const V2TIMStringVector &memberList, uint32_t markType, bool enableMark, V2TIMCallback *callback)=0
 
virtual void TransferGroupOwner (const V2TIMString &groupID, const V2TIMString &userID, V2TIMCallback *callback)=0
 
virtual void KickGroupMember (const V2TIMString &groupID, const V2TIMStringVector &memberList, const V2TIMString &reason, V2TIMValueCallback< V2TIMGroupMemberOperationResultVector > *callback)=0
 
virtual void GetGroupApplicationList (V2TIMValueCallback< V2TIMGroupApplicationResult > *callback)=0
 
virtual void AcceptGroupApplication (const V2TIMGroupApplication &application, const V2TIMString &reason, V2TIMCallback *callback)=0
 
virtual void RefuseGroupApplication (const V2TIMGroupApplication &application, const V2TIMString &reason, V2TIMCallback *callback)=0
 
virtual void SetGroupApplicationRead (V2TIMCallback *callback)=0
 
virtual void GetJoinedCommunityList (V2TIMValueCallback< V2TIMGroupInfoVector > *callback)=0
 
virtual void CreateTopicInCommunity (const V2TIMString &groupID, const V2TIMTopicInfo &topicInfo, V2TIMValueCallback< V2TIMString > *callback)=0
 
virtual void DeleteTopicFromCommunity (const V2TIMString &groupID, const V2TIMStringVector &topicIDList, V2TIMValueCallback< V2TIMTopicOperationResultVector > *callback)=0
 
virtual void SetTopicInfo (const V2TIMTopicInfo &topicInfo, V2TIMCallback *callback)=0
 
virtual void GetTopicInfoList (const V2TIMString &groupID, const V2TIMStringVector &topicIDList, V2TIMValueCallback< V2TIMTopicInfoResultVector > *callback)=0
 

Constructor & Destructor Documentation

◆ ~V2TIMGroupManager()

virtual ~V2TIMGroupManager ( )
inlinevirtual

Member Function Documentation

◆ CreateGroup()

virtual void CreateGroup ( const V2TIMGroupInfo info,
const V2TIMCreateGroupMemberInfoVector memberList,
V2TIMValueCallback< V2TIMString > *  callback 
)
pure virtual

1.1 Create a custom group (the advanced version API allows you to specify initial group members)

Parameters
infoCustom group information, including the groupID, groupType, groupName, notification, introduction, and faceURL fields
memberListSpecify initial group members (Audio-video groups do not support specifying initial group members. Pass in null for memberList.)
Attention
  • Limited by backgroud service, the number of memberList must be less than or equal to 20.
  • For other limits, please see V2TIMManager.h -> CreateGroup remarks

◆ GetJoinedGroupList()

virtual void GetJoinedGroupList ( V2TIMValueCallback< V2TIMGroupInfoVector > *  callback)
pure virtual

1.2 Get the list of groups that the current user has joined

Attention
  • Audio-video groups (AVChatRoom) do not support this API.
  • This API implements frequency limit checks. It can be called by the SDK for up to 10 times per second. When the limit is exceeded, the error ERR_SDK_COMM_API_CALL_FREQUENCY_LIMIT (7008) is reported.

◆ GetGroupsInfo()

virtual void GetGroupsInfo ( const V2TIMStringVector groupIDList,
V2TIMValueCallback< V2TIMGroupInfoResultVector > *  callback 
)
pure virtual

2.1 Pull group profiles

Parameters
groupIDListList of group IDs

◆ SearchGroups()

virtual void SearchGroups ( const V2TIMGroupSearchParam searchParam,
V2TIMValueCallback< V2TIMGroupInfoVector > *  callback 
)
pure virtual

2.2 Search for group profiles (supported only in 5.4.666 and later versions and need to buy Flagship Edition)

This API will search all the groups whose group name is included in the keyword list specifed in searchParam and return the group profiles list. The keyword list supports up to 5 keywords.

Parameters
searchParamSearch parameters

◆ SetGroupInfo()

virtual void SetGroupInfo ( const V2TIMGroupInfo info,
V2TIMCallback callback 
)
pure virtual

2.3 Modify group profiles

◆ InitGroupAttributes()

virtual void InitGroupAttributes ( const V2TIMString groupID,
const V2TIMGroupAttributeMap attributes,
V2TIMCallback callback 
)
pure virtual

2.4 Initialize group attributes (this operation will clear the existing group attribute list)

Attention
Use limits of attributes::
  • Group attribute is supported only for audio-video groups (AVChatRoom) by 6.7 and earlier versions.
  • Group attribute is supported for 4 group types (AVChatRoom、Public、Meeting、Work groups) at the same time in 6.8 and later versions.
  • Group attribute is supported for all group types except topics in 7.0 and later versions.
  • Up to 16 keys are supported, with a length limit of 32 bytes.
  • The length limit for value is 4 KB.
  • The total length limit for attributes (including keys and values) is 16 KB.
  • The initGroupAttributes, setGroupAttributes, and deleteGroupAttributes APIs each can be called by the SDK for up to 10 times per 5 seconds, and the 8511 error code will be called back if the limit is exceeded. The APIs each can be called by the backend for up to 5 times per second, and the 10049 error code will be called back if the limit is exceeded.
  • The getGroupAttributes API can be called by the SDK for up to 20 times per 5 seconds.
  • Starting from version 5.6, when you modify group attributes for the first time after the app is started, please call getGroupAttributes to pull the latest group attributes before you initiate the modification operation.
  • Starting from version 5.6, when multiple users modify the same group attributes at the same time, only the first user can execute successfully, and other users will receive the 10056 error code. After receiving this error code, please call getGroupAttributes to update the locally stored group attributes to the latest before you initiate the modification operation.

◆ SetGroupAttributes()

virtual void SetGroupAttributes ( const V2TIMString groupID,
const V2TIMGroupAttributeMap attributes,
V2TIMCallback callback 
)
pure virtual

2.5 Set group attributes. (If the group attributes already exist, their values are updated. Otherwise, the group attributes are added.)

Attention
  • Group attribute is supported only for audio-video groups (AVChatRoom) by 6.7 and earlier versions.
  • Group attribute is supported for 4 group types (AVChatRoom、Public、Meeting、Work groups) at the same time in 6.8 and later versions.
  • Group attribute is supported for all group types except topics in 7.0 and later versions.

◆ DeleteGroupAttributes()

virtual void DeleteGroupAttributes ( const V2TIMString groupID,
const V2TIMStringVector keys,
V2TIMCallback callback 
)
pure virtual

2.6 Delete specified group attributes (If size 0 is passed in for keys, all group attributes are cleared.)

Attention
  • Group attribute is supported only for audio-video groups (AVChatRoom) by 6.7 and earlier versions.
  • Group attribute is supported for 4 group types (AVChatRoom、Public、Meeting、Work groups) at the same time in 6.8 and later versions.
  • Group attribute is supported for all group types except topics in 7.0 and later versions.

◆ GetGroupAttributes()

virtual void GetGroupAttributes ( const V2TIMString groupID,
const V2TIMStringVector keys,
V2TIMValueCallback< V2TIMGroupAttributeMap > *  callback 
)
pure virtual

2.7 Get specified group attributes (If size 0 is passed in for keys, all group attributes are obtained.)

Attention
  • Group attribute is supported only for audio-video groups (AVChatRoom) by 6.7 and earlier versions.
  • Group attribute is supported for 4 group types (AVChatRoom、Public、Meeting、Work groups) at the same time in 6.8 and later versions.
  • Group attribute is supported for all group types except topics in 7.0 and later versions.

◆ GetGroupOnlineMemberCount()

virtual void GetGroupOnlineMemberCount ( const V2TIMString groupID,
V2TIMValueCallback< uint32_t > *  callback 
)
pure virtual

2.8 Get the number of online members of a group

Attention
Notes:
  • Currently, this API is supported only by audio-video groups (AVChatRoom).

◆ SetGroupCounters()

virtual void SetGroupCounters ( const V2TIMString groupID,
const V2TIMStringToInt64Map counters,
V2TIMValueCallback< V2TIMStringToInt64Map > *  callback 
)
pure virtual

2.9 Set group counters (supported only in 7.0 and later versions)

Attention
  • If the group counters already exist, their values will be updated. Otherwise, the group counters will be added.
  • When group counter is set successfully, their newest information will be returned in the succ callback.
  • Group counter is supported for all group types except community and topics.

◆ GetGroupCounters()

virtual void GetGroupCounters ( const V2TIMString groupID,
const V2TIMStringVector keys,
V2TIMValueCallback< V2TIMStringToInt64Map > *  callback 
)
pure virtual

2.10 Get group counters (supported only in 7.0 and later versions)

Attention
  • If keys is empty or nil, it means to obtain all counters in the group.
  • Group counter is supported for all group types except community and topics.

◆ IncreaseGroupCounter()

virtual void IncreaseGroupCounter ( const V2TIMString groupID,
const V2TIMString key,
int64_t  value,
V2TIMValueCallback< V2TIMStringToInt64Map > *  callback 
)
pure virtual

2.11 Increase group counters (supported only in 7.0 and later versions)

Parameters
groupIDGroup ID
keyThe key of counter
valueIncrement of group counter, the value will be updated as new_value = old_value + value
succCallback of success,returns the value of the current counter after increment
failCallback of failure
Attention
  • If the key of the counters specified by the parameters already exist, their values will be increased directly according to the parameters. Otherwise, new counters will be added firstly with value 0, then their value will be increased by the parameters.
  • Group counter is supported for all group types except community and topics.

◆ DecreaseGroupCounter()

virtual void DecreaseGroupCounter ( const V2TIMString groupID,
const V2TIMString key,
int64_t  value,
V2TIMValueCallback< V2TIMStringToInt64Map > *  callback 
)
pure virtual

2.12 Decrease group counters (supported only in 7.0 and later versions)

Parameters
groupIDGroup ID
keyThe key of counter
valueDecrement of group counter, the value will be updated as new_value = old_value - value
succCallback of success,returns the value of the current counter after decrement
failCallback of failure
Attention
  • If the key of the counters specified by the parameters already exist, their values will be decreased directly according to the parameters. Otherwise, new counters will be added firstly with value 0, then their value will be decreased by the parameters.
  • Group counter is supported for all group types except community and topics.

◆ GetGroupMemberList()

virtual void GetGroupMemberList ( const V2TIMString groupID,
uint32_t  filter,
uint64_t  nextSeq,
V2TIMValueCallback< V2TIMGroupMemberInfoResult > *  callback 
)
pure virtual

3.1 Get the group member list

Parameters
filterSpecify the group member type
nextSeqPulling-by-page flag. It is set to 0 when the information is pulled for the first time. If the callback succeeds and nextSeq is not 0, pagination is needed. The value of this field is passed in for the next pull until the value becomes 0.
Attention
  • Restrictions for normal groups(Work, Meeting, Public, Community):
  1. The filter field can only be set to the value defined in V2TIMGroupMemberFilter, then you can get the members of the corresponding role.
  • Restrictions for audio-video groups(AVChatRoom):
  1. If you set the filter to the value defined in V2TIMGroupMemberFilter, you will get all the members. The maximum number of group members supported in Flagship Edition is 1000, new members will be placed at the top of the list. You need to login in IM Console to enable this feature. If you don't enable, you will still get 31 members at the most like the Non-Flagship (supported only in 6.3 and later versions). The maximum number of group members supported in Non-Flagship Edition is 31, new members will be placed at the top of the list.
  2. If you set the filter to custom markType defined by yourself, you can get the members of the corresponding markType in the Flagship Edition. Please refer to the API MarkGroupMemberList.
  3. After the app is restarted, please join the group again. Otherwise, the 10007 error code will be reported when you pull the group member list.
  4. Only the following fields are supported in group member profiles: userID, nickName, faceURL, and role.

◆ GetGroupMembersInfo()

virtual void GetGroupMembersInfo ( const V2TIMString groupID,
V2TIMStringVector  memberList,
V2TIMValueCallback< V2TIMGroupMemberFullInfoVector > *  callback 
)
pure virtual

3.2 Get the profiles of specified group members

◆ SearchGroupMembers()

virtual void SearchGroupMembers ( const V2TIMGroupMemberSearchParam param,
V2TIMValueCallback< V2TIMGroupSearchGroupMembersMap > *  callback 
)
pure virtual

3.3 Search for group members (supported only in 5.4.666 and later versions and need to buy Flagship Edition)

Parameters
paramSearch parameters

◆ SetGroupMemberInfo()

virtual void SetGroupMemberInfo ( const V2TIMString groupID,
const V2TIMGroupMemberFullInfo info,
V2TIMCallback callback 
)
pure virtual

3.4 Modify the profiles of specified group members

◆ MuteGroupMember()

virtual void MuteGroupMember ( const V2TIMString groupID,
const V2TIMString userID,
uint32_t  seconds,
V2TIMCallback callback 
)
pure virtual

3.5 Mute (this API can be called by the admin or group owner)

Parameters
secondsTime period in seconds from calling this API which indicates how many seconds the mute user will be forbidden to speak.

◆ InviteUserToGroup()

virtual void InviteUserToGroup ( const V2TIMString groupID,
const V2TIMStringVector userList,
V2TIMValueCallback< V2TIMGroupMemberOperationResultVector > *  callback 
)
pure virtual

3.6 Invite users to a group

Attention
The limits for different types of groups are as follows:
  • Work group (Work): Anyone in the group can invite others to the group.
  • Meeting group (Meeting) and public group (Public): Users are not allowed to join the group through invitation by default. You can modify the groupApproveOpt field of the V2TIMGroupInfo to open it. After that, all the group members can invite others to join in the group.
  • Audio-video group (AVChatRoom): Inviting users to a group is not supported.
  • Limited by backgroud service, the number of userList must be less than or equal to 20.

◆ KickGroupMember() [1/2]

virtual void KickGroupMember ( const V2TIMString groupID,
const V2TIMStringVector memberList,
const V2TIMString reason,
uint32_t  duration,
V2TIMValueCallback< V2TIMGroupMemberOperationResultVector > *  callback 
)
pure virtual

3.7 Remove a member from a group

Parameters
groupIDGroup ID
memberListThe member list of kicked off
reasonThe reason why the member needed to kick off
durationTime interval during which the target users will not be allowed to join the group again after being kicked out of the group in seconds
callbackCallback
Attention
  • You can specificy a time interval in seconds during which the target users will not be allowed to join the group again after being kicked out of the group from 7.2 version.
  • Work group (Work): only the group owner or app admin can remove a member from a group.
  • Meeting group (Meeting) and public group (Public): the group owner, group admin, and app admin can remove a member from a group.
  • Audio-video group (AVChatRoom): only muting(muteGroupMember) is supported in versions prior to 6.6. Both muting(muteGroupMember) and kicking(kickGroupMember) are supported in 6.6 and later versions.
  • Please refer to the following link for other usage restrictions of this interface: https://cloud.tencent.com/document/product/269/75400#.E8.B8.A2.E4.BA.BA.

◆ SetGroupMemberRole()

virtual void SetGroupMemberRole ( const V2TIMString groupID,
const V2TIMString userID,
uint32_t  role,
V2TIMCallback callback 
)
pure virtual

3.8 Set the role of a group member

Attention
The limits for different types of groups are as follows:
  • Meeting group (Meeting) and public group (Public): only the group owner can switch the role of a group member between common member and admin.
  • Other types of groups do not support group member role setting.
  • To transfer a group, please call the transferGroupOwner API.
  • For a meeting group (Meeting), after a group member role is set, there will be no onGrantAdministrator or onRevokeAdministrator callback.
  • Roles that can be set are common member (V2TIM_GROUP_MEMBER_ROLE_MEMBER) and admin (V2TIM_GROUP_MEMBER_ROLE_ADMIN).

◆ MarkGroupMemberList()

virtual void MarkGroupMemberList ( const V2TIMString groupID,
const V2TIMStringVector memberList,
uint32_t  markType,
bool  enableMark,
V2TIMCallback callback 
)
pure virtual

3.9 Set or remove the custom roles of group member(supported only in 6.6 and later versions and need to buy Flagship Edition)

Parameters
groupIDGroup's identifier.
memberListGroup member's identifier list.
markTypeThe mark type is uint32_t, and the value must be equal or greater than 1000. You can customize it. A maximum of 10 marks are allowed to be defined in an AVChatRoom.
enableMarkSet or remove. true means setting the mark, and false means removing the mark.
Attention
Attention please:
  • Only supported in Audio-video group (AVChatRoom).
  • Only the group owner has permission to mark other members in the group.

◆ TransferGroupOwner()

virtual void TransferGroupOwner ( const V2TIMString groupID,
const V2TIMString userID,
V2TIMCallback callback 
)
pure virtual

3.10 Change the group owner

Attention
The limits for different types of groups are as follows:
  • Common groups (Work, Public, and Meeting): only the group owner has the permission to change the group owner.
  • Audio-video group (AVChatRoom): changing the group owner is not supported.

◆ KickGroupMember() [2/2]

virtual void KickGroupMember ( const V2TIMString groupID,
const V2TIMStringVector memberList,
const V2TIMString reason,
V2TIMValueCallback< V2TIMGroupMemberOperationResultVector > *  callback 
)
pure virtual

3.11 Remove a member from a group(Removing a member from AVChatRoom is supported only in 6.6 and later versions and need to buy Flagship Edition)

Attention
The limits are as follows:
  • It is deprecated and discouraged to call this function. Please call API KickGroupMember(const V2TIMString&, const V2TIMStringVector &, const V2TIMString&, uint32_t, V2TIMValueCallback) instead.
  • Work group (Work): only the group owner or app admin can remove a member from a group.
  • Meeting group (Meeting) and public group (Public): the group owner, group admin, and app admin can remove a member from a group.
  • Audio-video group (AVChatRoom): only muting(MuteGroupMember) is supported in versions prior to 6.6. Both muting(MuteGroupMember) and kicking(KickGroupMember) are supported in 6.6 and later versions.
  • Please refer to the following link for other usage restrictions of this interface: https://cloud.tencent.com/document/product/269/75400#.E8.B8.A2.E4.BA.BA.

◆ GetGroupApplicationList()

virtual void GetGroupApplicationList ( V2TIMValueCallback< V2TIMGroupApplicationResult > *  callback)
pure virtual

4.1 Get the group joining request list

Attention
Up to 50 requests are supported

◆ AcceptGroupApplication()

virtual void AcceptGroupApplication ( const V2TIMGroupApplication application,
const V2TIMString reason,
V2TIMCallback callback 
)
pure virtual

4.2 Approve a group joining request

◆ RefuseGroupApplication()

virtual void RefuseGroupApplication ( const V2TIMGroupApplication application,
const V2TIMString reason,
V2TIMCallback callback 
)
pure virtual

4.3 Reject a group joining request

◆ SetGroupApplicationRead()

virtual void SetGroupApplicationRead ( V2TIMCallback callback)
pure virtual

4.4 Mark the group joining request list as read

◆ GetJoinedCommunityList()

virtual void GetJoinedCommunityList ( V2TIMValueCallback< V2TIMGroupInfoVector > *  callback)
pure virtual

5.1 Get the list of Community-groups that the current user has joined

◆ CreateTopicInCommunity()

virtual void CreateTopicInCommunity ( const V2TIMString groupID,
const V2TIMTopicInfo topicInfo,
V2TIMValueCallback< V2TIMString > *  callback 
)
pure virtual

5.2 Create topic

◆ DeleteTopicFromCommunity()

virtual void DeleteTopicFromCommunity ( const V2TIMString groupID,
const V2TIMStringVector topicIDList,
V2TIMValueCallback< V2TIMTopicOperationResultVector > *  callback 
)
pure virtual

5.3 Delete topic

◆ SetTopicInfo()

virtual void SetTopicInfo ( const V2TIMTopicInfo topicInfo,
V2TIMCallback callback 
)
pure virtual

5.4 Modify topic information

◆ GetTopicInfoList()

virtual void GetTopicInfoList ( const V2TIMString groupID,
const V2TIMStringVector topicIDList,
V2TIMValueCallback< V2TIMTopicInfoResultVector > *  callback 
)
pure virtual

5.5 Get topic list

Attention
: When the topicIDList is empty,it means to get the list of all topics in this Community.