SDKsReact Native
Create a rich-text message
OpenIM React Native SDK guide for create a rich-text message.
Use createAdvancedTextMessage() to create a rich-text message with message entities.
const message = await OpenIMSDK.createAdvancedTextMessage({
text: 'See https://openim.io',
messageEntityList: [
{
type: 'url',
offset: 4,
length: 17,
url: 'https://openim.io',
},
],
});Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Raw rich-text content. |
messageEntityList | MessageEntity[] | No | Entities in the text. |
Each MessageEntity contains type, offset, and length, with optional url and info. The call returns a MessageItem ready to send. Use Send a message to send it.
Was this page helpful?