Browse SDKs · React Native
Platform
SDKsReact Native

Create rich-text quote message

Construct a rich-text reply message with text entities and referenced original message using the OpenIM React Native SDK.

Copy

Construct a rich-text reply message that references an original message and supports embedded entities:

const message = await OpenIMSDK.createAdvancedQuoteMessage({
  text: 'I have reviewed the related link.',
  message: originalMessage,
});

Parameters

ParameterTypeRequiredDescription
textstringYesRaw text content of the reply.
messageMessageItemYesOriginal referenced message object being quoted.
messageEntityListMessageEntity[]NoArray of custom text entities such as URLs or highlighted text segments.

Each MessageEntity specifies type, offset, and length, with optional url or info metadata.

Return value

A resolved Promise returns the initialized MessageItem object with quoting details populated in quoteElem.

This method constructs the message object locally in memory; it does not send network requests to the server or trigger message events. After creating the message, invoke Send message to dispatch it to a conversation.