SDKsReact Native
Create face message
Construct an emoji or sticker message using the OpenIM React Native SDK.
Construct a custom emoji or sticker message according to application protocols:
const message = await OpenIMSDK.createFaceMessage({
index: 12,
data: JSON.stringify({
url: 'https://www.example.com/emoji.png',
}),
});Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
index | number | Yes | Predefined index or identifier of the emoji/sticker. |
data | string | Yes | Custom payload string shared between sender and recipient (e.g. image URLs or animation attributes). |
Return value
A resolved Promise returns the initialized MessageItem object with sticker attributes stored in faceElem.
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?