Listener | Description |
SetOnAddFriendCallback | Callback for adding a friend |
SetOnDeleteFriendCallback | Callback for deleting a friend |
SetUpdateFriendProfileCallback | Callback for updating the profile of a friend |
SetFriendAddRequestCallback | Callback for a friend request |
SetFriendApplicationListDeletedCallback | Callback for deleting a friend request |
SetFriendApplicationListReadCallback | Callback for reading a friend request |
SetFriendBlackListAddedCallback | Callback for adding a friend to the blocklist |
SetFriendBlackListDeletedCallback | Callback for removing a friend from the blocklist |
null
to remove the contacts event listener.ProfileGetUserProfileList
API (Details) and enter a user's UserID
for the friendship_getprofilelist_param_identifier_array
parameter to query the user's profile.// Get a user's profileFriendShipGetProfileListParam param = new FriendShipGetProfileListParam{friendship_getprofilelist_param_identifier_array = new List<string>{"self_user_id"}};TIMResult res = TencentIMSDK.ProfileGetUserProfileList(param, (int code, string desc, List<UserProfile> profile, string user_data)=>{// Process the async logic});// Set the user's profileUserProfileItem param = new UserProfileItem{user_profile_item_nick_name = "new_nick_name"};TIMResult res = TencentIMSDK.ProfileGetUserProfileList(param, (int code, string desc, string user_data)=>{// Process the async logic});
ProfileGetUserProfileList
API (Details) and enter the UserID
of a non-friend user for the friendship_getprofilelist_param_identifier_array
parameter to query the profile of the non-friend user.FriendshipGetFriendsInfo
API (Details) to query the profile of the specified friend. The relationship between the user and the friend can be obtained through the friendship_friend_info_get_result_relation_type
field of the FriendInfoGetResult
in the callback:relation | Relationship |
TIMFriendshipRelationType.kTIMFriendshipRelationType_None | Not a friend |
TIMFriendshipRelationType.kTIMFriendshipRelationType_BothFriend | Two-way friend |
TIMFriendshipRelationType.kTIMFriendshipRelationType_InMyFriendList | The user is in your contacts. |
TIMFriendshipRelationType.kTIMFriendshipRelationType_InOtherFriendList | You are in the user's contacts. |
// Get the information of a friendTIMResult res = TencentIMSDK.FriendshipGetFriendsInfo(friend_userids, (int code, string desc, List<FriendInfoGetResult> result, string user_data)=>{// Process the async logic});
FriendshipModifyFriendProfile
API (Details) to modify the information of a friend such as remarks.// Set the friend's informationFriendshipModifyFriendProfileParam param = new FriendshipModifyFriendProfileParam{friendship_modify_friend_profile_param_identifier = "friend_userid",friendship_modify_friend_profile_param_item = new FriendProfileItem{friend_profile_item_remark = "nickname" // Friend remarks}};TIMResult res = TencentIMSDK.FriendshipModifyFriendProfile(param, (int code, string desc, string user_data)=>{// Process the async logic});
Was this page helpful?