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.
V2TIMFriendshipManagerabstract

Public Member Functions

virtual ~V2TIMFriendshipManager ()
 
virtual void AddFriendListener (V2TIMFriendshipListener *listener)=0
 
virtual void RemoveFriendListener (V2TIMFriendshipListener *listener)=0
 
virtual void GetFriendList (V2TIMValueCallback< V2TIMFriendInfoVector > *callback)=0
 
virtual void GetFriendsInfo (const V2TIMStringVector &userIDList, V2TIMValueCallback< V2TIMFriendInfoResultVector > *callback)=0
 
virtual void SetFriendInfo (const V2TIMFriendInfo &info, V2TIMCallback *callback)=0
 
virtual void SearchFriends (const V2TIMFriendSearchParam &searchParam, V2TIMValueCallback< V2TIMFriendInfoResultVector > *callback)=0
 
virtual void AddFriend (const V2TIMFriendAddApplication &application, V2TIMValueCallback< V2TIMFriendOperationResult > *callback)=0
 
virtual void DeleteFromFriendList (const V2TIMStringVector &userIDList, V2TIMFriendType deleteType, V2TIMValueCallback< V2TIMFriendOperationResultVector > *callback)=0
 
virtual void CheckFriend (const V2TIMStringVector &userIDList, V2TIMFriendType checkType, V2TIMValueCallback< V2TIMFriendCheckResultVector > *callback)=0
 
virtual void GetFriendApplicationList (V2TIMValueCallback< V2TIMFriendApplicationResult > *callback)=0
 
virtual void AcceptFriendApplication (const V2TIMFriendApplication &application, V2TIMFriendAcceptType acceptType, V2TIMValueCallback< V2TIMFriendOperationResult > *callback)=0
 
virtual void AcceptFriendApplication (const V2TIMFriendApplication &application, V2TIMFriendAcceptType acceptType, const V2TIMString &remark, V2TIMValueCallback< V2TIMFriendOperationResult > *callback)=0
 
virtual void RefuseFriendApplication (const V2TIMFriendApplication &application, V2TIMValueCallback< V2TIMFriendOperationResult > *callback)=0
 
virtual void DeleteFriendApplication (const V2TIMFriendApplication &application, V2TIMCallback *callback)=0
 
virtual void SetFriendApplicationRead (V2TIMCallback *callback)=0
 
virtual void AddToBlackList (const V2TIMStringVector &userIDList, V2TIMValueCallback< V2TIMFriendOperationResultVector > *callback)=0
 
virtual void DeleteFromBlackList (const V2TIMStringVector &userIDList, V2TIMValueCallback< V2TIMFriendOperationResultVector > *callback)=0
 
virtual void GetBlackList (V2TIMValueCallback< V2TIMFriendInfoVector > *callback)=0
 
virtual void CreateFriendGroup (const V2TIMString &groupName, const V2TIMStringVector &userIDList, V2TIMValueCallback< V2TIMFriendOperationResultVector > *callback)=0
 
virtual void GetFriendGroups (const V2TIMStringVector &groupNameList, V2TIMValueCallback< V2TIMFriendGroupVector > *callback)=0
 
virtual void DeleteFriendGroup (const V2TIMStringVector &groupNameList, V2TIMCallback *callback)=0
 
virtual void RenameFriendGroup (const V2TIMString &oldName, const V2TIMString &newName, V2TIMCallback *callback)=0
 
virtual void AddFriendsToFriendGroup (const V2TIMString &groupName, const V2TIMStringVector &userIDList, V2TIMValueCallback< V2TIMFriendOperationResultVector > *callback)=0
 
virtual void DeleteFriendsFromFriendGroup (const V2TIMString &groupName, const V2TIMStringVector &userIDList, V2TIMValueCallback< V2TIMFriendOperationResultVector > *callback)=0
 
virtual void SubscribeOfficialAccount (const V2TIMString &officialAccountID, V2TIMCallback *callback)=0
 
virtual void UnsubscribeOfficialAccount (const V2TIMString &officialAccountID, V2TIMCallback *callback)=0
 
virtual void GetOfficialAccountsInfo (const V2TIMStringVector &officialAccountIDList, V2TIMValueCallback< V2TIMOfficialAccountInfoResultVector > *callback)=0
 
virtual void FollowUser (const V2TIMStringVector &userIDList, V2TIMValueCallback< V2TIMFollowOperationResultVector > *callback)=0
 
virtual void UnfollowUser (const V2TIMStringVector &userIDList, V2TIMValueCallback< V2TIMFollowOperationResultVector > *callback)=0
 
virtual void GetMyFollowingList (const V2TIMString &nextCursor, V2TIMValueCallback< V2TIMUserInfoResult > *callback)=0
 
virtual void GetMyFollowersList (const V2TIMString &nextCursor, V2TIMValueCallback< V2TIMUserInfoResult > *callback)=0
 
virtual void GetMutualFollowersList (const V2TIMString &nextCursor, V2TIMValueCallback< V2TIMUserInfoResult > *callback)=0
 
virtual void GetUserFollowInfo (const V2TIMStringVector &userIDList, V2TIMValueCallback< V2TIMFollowInfoVector > *callback)=0
 
virtual void CheckFollowType (const V2TIMStringVector &userIDList, V2TIMValueCallback< V2TIMFollowTypeCheckResultVector > *callback)=0
 

Constructor & Destructor Documentation

◆ ~V2TIMFriendshipManager()

virtual ~V2TIMFriendshipManager ( )
inlinevirtual

Member Function Documentation

◆ AddFriendListener()

virtual void AddFriendListener ( V2TIMFriendshipListener listener)
pure virtual

1.1 Add the relationship chain listener

◆ RemoveFriendListener()

virtual void RemoveFriendListener ( V2TIMFriendshipListener listener)
pure virtual

1.2 Remove the relationship chain listener

◆ GetFriendList()

virtual void GetFriendList ( V2TIMValueCallback< V2TIMFriendInfoVector > *  callback)
pure virtual

2.1 Get the friend list

◆ GetFriendsInfo()

virtual void GetFriendsInfo ( const V2TIMStringVector userIDList,
V2TIMValueCallback< V2TIMFriendInfoResultVector > *  callback 
)
pure virtual

2.2 Get the profiles of specified friends

Parameters
userIDListList of friends' userIDs
  • You are advised to obtain a maximum of 100 user IDs at a time. A larger number may cause the request to be rejected by the backend due to an excessively large data packet. The maximum size of a data packet supported by the backend is 1 MB.

◆ SetFriendInfo()

virtual void SetFriendInfo ( const V2TIMFriendInfo info,
V2TIMCallback callback 
)
pure virtual

2.3 Set the profile of a specified friend

◆ SearchFriends()

virtual void SearchFriends ( const V2TIMFriendSearchParam searchParam,
V2TIMValueCallback< V2TIMFriendInfoResultVector > *  callback 
)
pure virtual

2.4 Search for friends (supported only in Chat Premium 5.4.666 and later versions)

◆ AddFriend()

virtual void AddFriend ( const V2TIMFriendAddApplication application,
V2TIMValueCallback< V2TIMFriendOperationResult > *  callback 
)
pure virtual

2.5 Add a friend

◆ DeleteFromFriendList()

virtual void DeleteFromFriendList ( const V2TIMStringVector userIDList,
V2TIMFriendType  deleteType,
V2TIMValueCallback< V2TIMFriendOperationResultVector > *  callback 
)
pure virtual

2.6 Delete friends

Parameters
userIDListList of the friend userIDs to be deleted
  • You are advised to delete a maximum of 100 user IDs at a time. A larger number may cause the request to be rejected by the backend due to an excessively large data packet. The maximum size of a data packet supported by the backend is 1 MB.
deleteTypeDeletion type
  • V2TIM_FRIEND_TYPE_SINGLE: one-way friend
  • V2TIM_FRIEND_TYPE_BOTH:two-way friend

◆ CheckFriend()

virtual void CheckFriend ( const V2TIMStringVector userIDList,
V2TIMFriendType  checkType,
V2TIMValueCallback< V2TIMFriendCheckResultVector > *  callback 
)
pure virtual

2.7 Check your relationships with specified users

Parameters
userIDListList of the userIDs to be checked
checkTypeCheck type (one-way or two-way friend check)
Attention
Notes for using checkType:
  • If V2TIM_FRIEND_TYPE_SINGLE is passed in for checkType, the possible results are V2TIM_FRIEND_RELATION_TYPE_NONE and V2TIM_FRIEND_RELATION_TYPE_IN_MY_FRIEND_LIST.
  • If V2TIM_FRIEND_TYPE_BOTH is passed in for checkType, the possible results are V2TIM_FRIEND_RELATION_TYPE_NONE, V2TIM_FRIEND_RELATION_TYPE_IN_MY_FRIEND_LIST, V2TIM_FRIEND_RELATION_TYPE_IN_OTHER_FRIEND_LIST, and V2TIM_FRIEND_RELATION_TYPE_BOTH_WAY. V2TIM_FRIEND_RELATION_TYPE_IN_OTHER_FRIEND_LIST、V2TIM_FRIEND_RELATION_TYPE_BOTH_WAY

◆ GetFriendApplicationList()

virtual void GetFriendApplicationList ( V2TIMValueCallback< V2TIMFriendApplicationResult > *  callback)
pure virtual

3.1 Get the friend request list

Attention
  • The friend request list includes the friend requests sent and received by yourself.
  • Up to 100 requests are supported.

◆ AcceptFriendApplication() [1/2]

virtual void AcceptFriendApplication ( const V2TIMFriendApplication application,
V2TIMFriendAcceptType  acceptType,
V2TIMValueCallback< V2TIMFriendOperationResult > *  callback 
)
pure virtual

3.2 Accept friend requests

Parameters
applicationFriend request information, which will be returned when calling getFriendApplicationList is successful
responseTypeBuild one-way or two-way friend relationships

◆ AcceptFriendApplication() [2/2]

virtual void AcceptFriendApplication ( const V2TIMFriendApplication application,
V2TIMFriendAcceptType  acceptType,
const V2TIMString remark,
V2TIMValueCallback< V2TIMFriendOperationResult > *  callback 
)
pure virtual

3.3 Accept friend requests and set a remark

Parameters
applicationFriend request information, which will be returned when calling getFriendApplicationList is successful
responseTypeBuild one-way or two-way friend relationships
remarkFriend remark,maximum 96 bytes

◆ RefuseFriendApplication()

virtual void RefuseFriendApplication ( const V2TIMFriendApplication application,
V2TIMValueCallback< V2TIMFriendOperationResult > *  callback 
)
pure virtual

3.4 Reject friend requests

Parameters
applicationFriend request information, which will be returned when calling GetFriendApplicationList is successful

◆ DeleteFriendApplication()

virtual void DeleteFriendApplication ( const V2TIMFriendApplication application,
V2TIMCallback callback 
)
pure virtual

3.5 Delete friend requests

Parameters
applicationFriend request information, which will be returned when calling GetFriendApplicationList is successful

◆ SetFriendApplicationRead()

virtual void SetFriendApplicationRead ( V2TIMCallback callback)
pure virtual

3.6 Set a friend request as read

◆ AddToBlackList()

virtual void AddToBlackList ( const V2TIMStringVector userIDList,
V2TIMValueCallback< V2TIMFriendOperationResultVector > *  callback 
)
pure virtual

4.1 Add users to the blocklist

◆ DeleteFromBlackList()

virtual void DeleteFromBlackList ( const V2TIMStringVector userIDList,
V2TIMValueCallback< V2TIMFriendOperationResultVector > *  callback 
)
pure virtual

4.2 Delete users from the blocklist

◆ GetBlackList()

virtual void GetBlackList ( V2TIMValueCallback< V2TIMFriendInfoVector > *  callback)
pure virtual

4.3 Get the blocklist

◆ CreateFriendGroup()

virtual void CreateFriendGroup ( const V2TIMString groupName,
const V2TIMStringVector userIDList,
V2TIMValueCallback< V2TIMFriendOperationResultVector > *  callback 
)
pure virtual

5.1 Create a friend group

Parameters
groupNameFriend group name
userIDListList of the friend userIDs to be added to the friend group

◆ GetFriendGroups()

virtual void GetFriendGroups ( const V2TIMStringVector groupNameList,
V2TIMValueCallback< V2TIMFriendGroupVector > *  callback 
)
pure virtual

5.2 Get friend group information

Parameters
groupNameListList of the names of the friend groups whose information is to be obtained. If null is passed in, the information of all friend groups is obtained.

◆ DeleteFriendGroup()

virtual void DeleteFriendGroup ( const V2TIMStringVector groupNameList,
V2TIMCallback callback 
)
pure virtual

5.3 Delete friend groups

◆ RenameFriendGroup()

virtual void RenameFriendGroup ( const V2TIMString oldName,
const V2TIMString newName,
V2TIMCallback callback 
)
pure virtual

5.4 Modify the name of a friend group

Parameters
oldNameold group name
newNamenew group name
callbackcallback

◆ AddFriendsToFriendGroup()

virtual void AddFriendsToFriendGroup ( const V2TIMString groupName,
const V2TIMStringVector userIDList,
V2TIMValueCallback< V2TIMFriendOperationResultVector > *  callback 
)
pure virtual

5.5 Add friends to a friend group

◆ DeleteFriendsFromFriendGroup()

virtual void DeleteFriendsFromFriendGroup ( const V2TIMString groupName,
const V2TIMStringVector userIDList,
V2TIMValueCallback< V2TIMFriendOperationResultVector > *  callback 
)
pure virtual

5.6 Delete friends from a friend group

◆ SubscribeOfficialAccount()

virtual void SubscribeOfficialAccount ( const V2TIMString officialAccountID,
V2TIMCallback callback 
)
pure virtual

6.1 Subscribe to an official account.(supported only in 7.6 and later versions)

◆ UnsubscribeOfficialAccount()

virtual void UnsubscribeOfficialAccount ( const V2TIMString officialAccountID,
V2TIMCallback callback 
)
pure virtual

6.2 Unsubscribe from an official account..(supported only in 7.6 and later versions)

◆ GetOfficialAccountsInfo()

virtual void GetOfficialAccountsInfo ( const V2TIMStringVector officialAccountIDList,
V2TIMValueCallback< V2TIMOfficialAccountInfoResultVector > *  callback 
)
pure virtual

6.3 Get a list of official accounts.(supported only in 7.6 and later versions)

Attention
When the officialAccountIDList is empty,it means to get the list of subscribed official accounts.

◆ FollowUser()

virtual void FollowUser ( const V2TIMStringVector userIDList,
V2TIMValueCallback< V2TIMFollowOperationResultVector > *  callback 
)
pure virtual

7.1 Follow users (supported only in Chat Premium 7.8 and later versions)

Attention
The maximum number of users you can follow at one time is 20.

◆ UnfollowUser()

virtual void UnfollowUser ( const V2TIMStringVector userIDList,
V2TIMValueCallback< V2TIMFollowOperationResultVector > *  callback 
)
pure virtual

7.2 Unfollow users (supported only in Chat Premium 7.8 and later versions)

Attention
The maximum number of users you can unfollow at one time is 20.

◆ GetMyFollowingList()

virtual void GetMyFollowingList ( const V2TIMString nextCursor,
V2TIMValueCallback< V2TIMUserInfoResult > *  callback 
)
pure virtual

7.3 Get a list of the users I follow (supported only in Chat Premium 7.8 and later versions)

Parameters
nextCursorPulling-by-page flag. It can be set to null or "" when the information is pulled for the first time. If the API is called successfully and nextCursor returned by the callback is not "", the results are paginated. The value of this field should be passed in for the next pulling until nextCursor becomes "".

◆ GetMyFollowersList()

virtual void GetMyFollowersList ( const V2TIMString nextCursor,
V2TIMValueCallback< V2TIMUserInfoResult > *  callback 
)
pure virtual

7.4 Get a list of my followers (supported only in Chat Premium 7.8 and later versions)

Parameters
nextCursorPulling-by-page flag. It can be set to "" when the information is pulled for the first time. If the API is called successfully and nextCursor returned by the callback is not "", the results are paginated. The value of this field should be passed in for the next pulling until nextCursor becomes "".

◆ GetMutualFollowersList()

virtual void GetMutualFollowersList ( const V2TIMString nextCursor,
V2TIMValueCallback< V2TIMUserInfoResult > *  callback 
)
pure virtual

7.5 Get a list of my mutual followers (supported only in Chat Premium 7.8 and later versions)

Parameters
nextCursorPulling-by-page flag. It can be set to "" when the information is pulled for the first time. If the callback succeeds and nextCursor returned is not "", pagination is needed. The value of this field can be passed in for the next pulling until the value becomes "".

◆ GetUserFollowInfo()

virtual void GetUserFollowInfo ( const V2TIMStringVector userIDList,
V2TIMValueCallback< V2TIMFollowInfoVector > *  callback 
)
pure virtual

7.6 Get the follow info of specified users (supported only in Chat Premium 7.8 and later versions)

◆ CheckFollowType()

virtual void CheckFollowType ( const V2TIMStringVector userIDList,
V2TIMValueCallback< V2TIMFollowTypeCheckResultVector > *  callback 
)
pure virtual

7.7 Check follow type of specified users (supported only in Chat Premium 7.8 and later versions)