Browse SDKs · React Native
Platform
SDKsReact Native

Create face message

Construct an emoji or sticker message using the OpenIM React Native SDK.

Copy

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

ParameterTypeRequiredDescription
indexnumberYesPredefined index or identifier of the emoji/sticker.
datastringYesCustom 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.