TIMMsgSearchCloudMessages

功能介绍

搜索云端消息

本地消息搜索为 IM 旗舰版功能,购买 旗舰版套餐包 后可使用,详见 价格说明

参数详解

参数名称 参数类型 是否必填 描述
msgSearchLocalMessagesParams MsgSearchLocalMessagesParams 搜索消息的参数

返回模板

Promise<commonResult<MessageSearchResult>>

{
    code: TIMResult | TIMErrCode;
    desc?: string | undefined;
    json_param?: MessageSearchResult | undefined;
    json_params?: MessageSearchResult | undefined; // 兼容
    user_data?: string | undefined;
}

返回值详解

名称 数值类型 描述
code TIMResultTIMErrCode 返回状态码
desc string | undefined 返回描述
json_param MessageSearchResult | undefined 根据具具体接口返回
json_params MessageSearchResult | undefined 兼容的字段,某些情况下会返回这个,根据具体接口返回
user_data string | undefined ImSDK负责透传的用户自定义数据,未做任何处理

代码示例

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.TIMMsgSearchCloudMessages(param);
if(code == 0){
    // 成功
}

results matching ""

    No results matching ""