Browse SDKs · Flutter
Platform
SDKsFlutter

Create an emoji message

Create an emoji message with the OpenIM Flutter SDK.

Copy

Construct an emoji or sticker message object using built-in or custom sticker pack definitions:

Parameters

ParameterTypeRequiredDescription
indexintYesNumeric index of the emoji or sticker defined by your application protocol.
dataStringYesAdditional emoji payload, such as a remote URL, animated sticker resource identifier, or custom JSON string.

Code example

final message = await OpenIM.iMManager.messageManager
    .createFaceMessage(index: 3, data: emojiURL);

The emoji index scheme and payload structure are agreed upon at the application layer. We recommend implementing fallback rendering for missing or unrecognized emoji packs on the recipient client.

Return value

Returns a Future resolving to an emoji Message object ready for transmission. Its payload is stored in faceElem.

State changes after the call

Creating a message only constructs the local message data structure in memory; it does not perform network transmission and does not trigger new-message event callbacks. Once constructed, pass the returned Message instance to Send a message to deliver it to a direct or group conversation.