Browse SDKs · React Native
SDKsReact Native

Insert a local one-to-one message

OpenIM React Native SDK guide for insert a local one-to-one message.

Copy

Use insertSingleMessageToLocalStorage() to write one message to the current device's direct-chat history.

await OpenIMSDK.insertSingleMessageToLocalStorage({
  message,
  recvID,
  sendID,
});

Parameters

ParameterTypeRequiredDescription
messageMessageItemYesComplete message object to write.
recvIDstringYesDirect-chat recipient user ID.
sendIDstringYesMessage sender user ID.

After the call completes, the message is written to the current device's direct-chat history. To send it to the other participant, use Send a message.