tencent cloud

Chat

Unity

下载
聚焦模式
字号
最后更新时间: 2024-02-07 11:03:46

Feature Description

Only locally stored users can be searched for, such as contacts or user profiles that have been pulled.

Searching for the Local User Profile

Call the FriendshipSearchFriends API (Details) to search for the local user profile. You can set the search keyword friendship_search_param_keyword_list and specify the search scope to set whether to search by the userID, nickName, and remark fields of a user.
Sample code:
// Search for a friend by keyword
FriendSearchParam param = new FriendSearchParam
{
friendship_search_param_keyword_list = new List<string>
{
"Keyword 1"
},
friendship_search_param_search_field_list = new List<TIMFriendshipSearchFieldKey>
{
TIMFriendshipSearchFieldKey.kTIMFriendshipSearchFieldKey_Identifier,
TIMFriendshipSearchFieldKey.kTIMFriendshipSearchFieldKey_NikeName,
TIMFriendshipSearchFieldKey.kTIMFriendshipSearchFieldKey_Remark
}
};
TIMResult res = TencentIMSDK.MsgSearchLocalMessages(param, (int code, string desc, List<FriendInfoGetResult> result, string user_data)=>{
// Process the async logic
});

帮助和支持

本页内容是否解决了您的问题?

填写满意度调查问卷,共创更好文档体验。

文档反馈