TIMMsgSearchLocalMessages
功能介绍
搜索本地消息
消息搜索只能搜索本地存储的消息,例如接收到的消息、调用拉取历史消息接口得到的消息等。
本地消息搜索为 IM 旗舰版功能,购买 旗舰版套餐包 后可使用,详见 价格说明。
参数详解
返回模板
Promise<commonResult<MessageSearchResult>>
{
code: TIMResult | TIMErrCode;
desc?: string | undefined;
json_param?: MessageSearchResult | undefined;
json_params?: MessageSearchResult | undefined;
user_data?: string | undefined;
}
返回值详解
代码示例
import TimRender from "im_electron_sdk/dist/renderer";
const timRenderInstance = new TimRender();
import { MsgSearchLocalMessagesParams,Json_search_message_param } from "im_electron_sdk/dist/interfaces";
let params : Json_search_message_param = {
msg_search_param_keyword_array: [""],
msg_search_param_message_type_array: [0],
msg_search_param_conv_id: '',
msg_search_param_conv_type: 1,
msg_search_param_search_time_position: 0,
msg_search_param_search_time_period: 24*60*60*7,
msg_search_param_page_index: 0,
msg_search_param_page_size: 100,
msg_search_param_keyword_list_match_type: 0,
msg_search_param_send_identifier_array: ['']
}
let param:MsgSearchLocalMessagesParams = {
params: params,
user_data: ''
}
const {code} = await timRenderInstance.TIMMsgSearchLocalMessages(param);
if(code == 0){
}