TIMMsgSetLocalCustomData
Introduction
Set message custom data (save locally, will not be sent to the peer, and will become invalid after the program is uninstalled or reinstalled)
Parameter details
Parameter name | Parameter type | Required | Description |
---|---|---|---|
params | SetLocalCustomDataParam | yes | Set message custom data parameters |
Returned template
Promise<commonResult<string>>
{
code: TIMResult | TIMErrCode;
desc?: string | undefined;
json_param?: string | undefined;
json_params?: string | undefined;
user_data?: string | undefined;
}
Return value details
This function has no return value
Code example
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
}
}