TencentImSDKPlugin.v2TIMManager.getFriendshipManager() core class.removeFriendListener API (details) to remove the contacts event listener.// Set the contacts listenerV2TimFriendshipListener listener = V2TimFriendshipListener(onBlackListAdd: (List<V2TimFriendInfo> infoList) async {// Callback for adding a user to the blocklist// infoList: List of information of the user added},onBlackListDeleted: (List<String> userList) async {// Callback for removing users from the blocklist// userList: List of IDs of the users deleted},onFriendApplicationListAdded:(List<V2TimFriendApplication> applicationList) async {// Callback for the increase of friend requests// applicationList: List of the information of new friend requests},onFriendApplicationListDeleted: (List<String> userIDList) async {// Callback for the decrease of friend requests// userIDList: List of user IDs corresponding to the friend requests decreased},onFriendApplicationListRead: () async {// Callback for read friend request},onFriendInfoChanged: (List<V2TimFriendInfo> infoList) async {// Callback for friend information changes// infoList: list of friends whose information changes},onFriendListAdded: (List<V2TimFriendInfo> users) async {// Callback for the increase of users in the friend list// users: list of users added},onFriendListDeleted: (List<String> userList) async {// Callback for the decrease of users in the friend list// userList: list of users deleted},);TencentImSDKPlugin.v2TIMManager.getFriendshipManager().addFriendListener(listener: listener); // Add a contacts listener// Remove the contacts listenerfriendshipManager.removeFriendListener(listener: friendshipListener);
getUsersInfo API (details) with the userIDList parameter set to a user's UserID to query the user's profile.onSelfInfoUpdated callback (details).// Obtain a user's personal profileV2TimValueCallback<String> self = await TencentImSDKPlugin.v2TIMManager.getLoginUser();TencentImSDKPlugin.v2TIMManager.getUsersInfo(userIDList: [self.data]);// Set the user's profileTencentImSDKPlugin.v2TIMManager.setSelfInfo(userFullInfo: V2TimUserFullInfo(nickName: "",role: 0,faceUrl: ""));
getUsersInfo API (details) with the userIDList parameter set to a non-friend user's UserID to query the non-friend user's profile.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 friend informationV2TimValueCallback<List<V2TimFriendInfoResult>> friendsInfo = await friendshipManager.getFriendsInfo(userIDList: []);
// Set friend informationTencentImSDKPlugin.v2TIMManager.setSelfInfo(userFullInfo: V2TimUserFullInfo(nickName: "",role: 0,faceUrl: ""));
Feedback