setLocalCustomData
Introduction
Set the custom data for a given message on local.
The data created by this method will only stored in local, while not sent to other users, and will lost after re-installing.
Parameter details
Parameter name | Parameter type | Required | Description |
---|---|---|---|
messageID | string | yes | The msgId of the message. |
localCustomData | string | yes | The custom data for the message. |
Returned template
V2TimCallback
{
code : number
desc : string
}
Return value details
name | type | description |
---|---|---|
code | number | Request result: Error codes. 0 means success. |
desc | string | The description of the error. It will be empty if success. |
Code example
import { TencentImSDKPlugin } from 'react-native-tim-js';
const setLocalCustomDataRes = await TencentImSDKPlugin.v2TIMManager
.getMessageManager()
.setLocalCustomData(
'msgID',
'localCustomData'
);
if (setLocalCustomDataRes.code === 0) {
}