Browse SDKs · React Native
Platform
SDKsReact NativeEnterprise

Save local transcript

Save speech-to-text transcription results to a local voice message on the current device using the OpenIM React Native SDK.

Copy

Persist audio transcription text to a locally stored voice message on the current device:

Pass the updated full MessageItem object while preserving all existing properties.

const updatedMessage = {
  ...message,
  soundElem: {
    ...message.soundElem,
    text: {
      text: transcript,
      translate: message.soundElem?.text?.translate ?? {},
    },
  },
};

await OpenIMSDK.setMessageLocalContent({
  conversationID,
  message: updatedMessage,
});

Parameters

ParameterTypeRequiredDescription
conversationIDstringYesTarget conversation ID.
messageMessageItemYesComplete message object incorporating the updated transcription text.

Return value

A resolved Promise confirms that the transcription text was successfully saved to the local SQLite database on the current device.

This modification is stored strictly on the local client; it is not synchronized to remote servers and does not trigger multi-device sync events. Reconcile the UI view by updating the message bubble keyed by clientMsgID within the scope of the corresponding conversationID.