TencentImSDKPlugin.v2TIMManager.getFriendshipManager()
core class.removeFriendListener
(Details) to remove the contacts event listener.// Add a contacts listenerconst frindshipListener = {onBlackListAdd: (infoList) => {},onBlackListDeleted: (userids) => {},onFriendApplicationListAdded: (applicationlist) => {},onFriendApplicationListDeleted: (applicationlist) => {},onFriendApplicationListRead: () => {},onFriendInfoChanged: (frindInfolist) => {},onFriendListAdded: (frindInfolist) => {},onFriendListDeleted: (userd) => {},};friendshipManager.addFriendListener(frindshipListener);// Remove the contacts listenerfriendshipManager.removeFriendListener(frindshipListener);
getUsersInfo
API (Details) and enter a user's UserID
for the userIDList
parameter to query the user's profile.setSelfInfo
API (Details) to modify a user's profile.
After the profile is modified successfully, you will receive the onSelfInfoUpdated
callback (Details).// Get a user's profileconst self = await TencentImSDKPlugin.v2TIMManager.getLoginUser();TencentImSDKPlugin.v2TIMManager.getUsersInfo([self.data]);// Set the user's profileTencentImSDKPlugin.v2TIMManager.setSelfInfo({nickName: "",role: 0,faceUrl: "",});
getUsersInfo
API (Details) and enter the UserID
of a non-friend user for the userIDList
parameter to query the profile of the non-friend user.getFriendsInfo
API (Details) to query the profile of the specified friend. The relationship between the user and the friend can be obtained through the relation
field of the V2TIMFriendInfoResult
in the callback:relation | Relationship |
V2TIM_FRIEND_RELATION_TYPE_NONE | Not a friend |
V2TIM_FRIEND_RELATION_TYPE_BOTH_WAY | Two-way friend |
V2TIM_FRIEND_RELATION_TYPE_IN_MY_FRIEND_LIST | The user is in your contacts. |
V2TIM_FRIEND_RELATION_TYPE_IN_OTHER_FRIEND_LIST | You are in the user's contacts. |
// Get the information of a friendconst friendsInfo = await friendshipManager.getFriendsInfo(["userID"]);
// Set the friend's informationTencentImSDKPlugin.v2TIMManager.setSelfInfo({nickName: "",role: 0,faceUrl: "",});
Was this page helpful?