TIMMsgSetLocalCustomData

功能介绍

设置消息自定义数据(本地保存,不会发送到对端,程序卸载重装后失效)

参数详解

参数名称 参数类型 是否必填 描述
params SetLocalCustomDataParam 设置消息自定义数据参数

返回模板

Promise<commonResult<string>>

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

返回值详解

此函数无返回值

代码示例

import TimRender from "im_electron_sdk/dist/renderer";
const timRenderInstance = new TimRender();
import { SetLocalCustomDataParam } from "im_electron_sdk/dist/interfaces";
let { code1, json_params } = await timRenderInstance.TIMMsgGetMsgList(null);
if (code1 == 0) {
    let message1 = json_params[0];
        message1.message_custom_str = "hello here";
        let param:SetLocalCustomDataParam={
            json_msg_param: message1,
            user_data: ""
        }
   let {code} = await timRenderInstance.TIMMsgSetLocalCustomData(param);
    if (code == 0) {
        // success
    }
}

results matching ""

    No results matching ""