SDKsReact Native
Create text message
Construct a basic plain-text message using the OpenIM React Native SDK.
Construct a standard plain-text chat message:
const message = await OpenIMSDK.createTextMessage('Hello, welcome to the discussion.');Parameters
Supply the plain-text message string as the sole argument.
Return value
A resolved Promise returns the initialized MessageItem object with message body populated in textElem.
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 one-to-one or group conversation.
Was this page helpful?