SDKsHarmonyOSEnterprise
Create sticker message
Create a sticker or custom emoji message from index numbers and payload data.
Creates a custom sticker or emoji message identified by index code and associated data.
Code example
import sdk, { CreateFaceMessageReq, CreateFaceMessageResp } from '@openimsdk/imsdk';
const request: CreateFaceMessageReq = {
index: 1001,
data: JSON.stringify({ packID: 'default', name: 'wave' }),
};
const response: CreateFaceMessageResp = await sdk.createFaceMessage(request);
const message = response.message;Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
index | number | Yes | Custom sticker index number. |
data | string | Yes | Supplementary sticker data string (for example, pack ID and name). |
Return value
Returns a Promise resolving to CreateFaceMessageResp:
| Property | Type | Description |
|---|---|---|
message | IMMessage | Locally instantiated sticker message object. |
State changes after the call
Both sending and receiving clients should adhere to a unified emoji indexing protocol and provide graceful fallback rendering for unknown indexes. The SDK does not download, validate, or render graphic assets directly. This operation creates the message object locally; call Send message to dispatch it.
Was this page helpful?