Browse SDKs · React Native
Platform
SDKsReact Native

Set message local extension

Store custom device-local extension strings on a specific message using the OpenIM React Native SDK.

Copy

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

ParameterTypeRequiredDescription
conversationIDstringYesConversation ID containing the message.
clientMsgIDstringYesTarget client message ID.
localExstringYesCustom 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.