SDKsAndroid
Create an emoji message
Use createFaceMessage to create a custom emoji message.
Construct a custom sticker or large emoji message object containing an index identifier and custom metadata. This is typically used for app-defined sticker packs, animated emojis, and custom reaction stickers.
Code example
int index = 101; // Emoji index number
String dataJson = "{\"packID\":\"pack_classic\",\"url\":\"https://example.com/face/101.gif\"}";
Message message = OpenIMClient.getInstance().messageManager.createFaceMessage(index, dataJson);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
index | int | Yes | Custom emoji index number defined by your application's sticker library. |
data | String | Yes | Serialized JSON string with sticker metadata (such as animated image URL, sticker pack name, etc.). |
Return value
Returns the created Message object with contentType set to MessageType.FACE.
State changes after the call
- Local initialization: Initializes the local
Messagestructure without sending data to the server. - Transmission: Call Send a message to deliver the sticker message to a single user or group.
Was this page helpful?