Browse SDKs · React Native
Platform
SDKsReact Native

Create quote message

Construct a reply message referencing an original message using the OpenIM React Native SDK.

Copy

Construct a reply message referencing an original message:

const message = await OpenIMSDK.createQuoteMessage({
  text: 'I agree with this proposal.',
  message: originalMessage,
});

Parameters

ParameterTypeRequiredDescription
textstringYesText content of the reply.
messageMessageItemYesComplete MessageItem object of the original message being referenced.

Return value

A resolved Promise returns the initialized MessageItem object with quoted message attributes stored in quoteElem.

This method builds the message structure strictly in client memory; it does not dispatch messages to the server or trigger lifecycle events. After initialization, invoke Send message to deliver it to a conversation. When displaying replies, ensure the UI gracefully handles cases where the referenced message has been revoked or deleted. To attach rich text entities alongside a quote, see Create rich-text quote message.