Browse SDKs · React Native
SDKsReact Native

Create a rich-text reply

OpenIM React Native SDK guide for create a rich-text reply.

Copy

Use createAdvancedQuoteMessage() to create a rich-text reply with an original-message reference and text entities.

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

Parameters

ParameterTypeRequiredDescription
textstringYesRaw reply text.
messageMessageItemYesOriginal message being replied to.
messageEntityListMessageEntity[]NoEntities in the text.

MessageEntity uses type, offset, and length to describe an entity, with optional url and info. The call returns a MessageItem ready to send.