searchLocalMessages
Introduction
Search the local messages.
Do not works on Web.
Can only search in local.
Works since version 3.8.0.
This method only works with Ultimate Edition, you can find the pricing plan here.
Searching for the Messages in All the Conversations
Searching for the Messages in the Specified Conversation
Typical Use Cases for the Search
Parameter details
Parameter name | Parameter type | Required | Platform | Description |
---|---|---|---|---|
searchParam | V2TimMessageSearchParam | yes | All | The search parameter. |
Returned template
V2TimValueCallback<V2TimMessageSearchResult>
{
code : int
desc : String
data : {
messageSearchResultItems : List<V2TimMessageSearchResultItem>// The list of search result messages.
totalCount : int // The amount of results.
}
}
Return value details
name | type | description |
---|---|---|
code | int | Request result: Error codes. 0 means success. |
desc | String | The description of the failure. |
data | V2TimMessageSearchResult | The list of search result messages. |
Code example
V2TimMessageSearchParam searchParam = new V2TimMessageSearchParam(
conversationID: "",
keywordList: [],
type: 0,
userIDList: [],
messageTypeList: [],
searchTimePeriod: 0,
searchTimePosition: 0,
pageIndex: 0,
pageSize: 10);
V2TimValueCallback<V2TimMessageSearchResult> searchLocalMessagesRes = await TencentImSDKPlugin
.v2TIMManager
.getMessageManager()
.searchLocalMessages(
searchParam:searchParam
);
if(searchLocalMessagesRes.code == 0){
}