SDKsReact Native
Set message local extension
Store custom device-local extension strings on a specific message using the OpenIM React Native SDK.
Attach custom local metadata to a specific message record stored on the current device:
This field is maintained solely within the local SQLite database on the client; it is never transmitted to the server or synced to other devices. It is commonly used for caching local media playback states, audio transcript UI toggles, or draft references.
await OpenIMSDK.setMessageLocalEx({
conversationID,
clientMsgID,
localEx: JSON.stringify({ isPlaying: false, isExpanded: true }),
});Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationID | string | Yes | Conversation ID containing the message. |
clientMsgID | string | Yes | Target client message ID. |
localEx | string | Yes | Custom local extension string, typically formatted as a JSON string for structured attributes. |
Return value
A resolved Promise confirms that the local extension string was written to the local database. Reconcile the local UI state by updating the localEx property of the corresponding message identified by clientMsgID.
Was this page helpful?