SDKsiOS
Create an emoji message
Create an emoji message with OpenIM iOS SDK.
Invoke createFaceMessageWithIndex:data: on OIMMessageInfo to construct an in-app sticker or custom face emoji message object:
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
index | NSInteger | Yes | Numeric index of the sticker within the sticker package. |
data | NSString * | Yes | Sticker protocol identifier, key name, or custom JSON string. |
Code example
OIMMessageInfo *message =
[OIMMessageInfo createFaceMessageWithIndex:1 data:@"smile"];Return value
Returns an initialized OIMMessageInfo model with its content type set to custom emoji/sticker.
State changes after the call
- Local memory instantiation: This method builds an in-memory message object without writing to the database or initiating network requests.
- Sticker protocol agreement: The semantics of
indexanddataare defined by the application layer. Ensure that the sending and receiving clients adhere to matching sticker resources and provide fallback rendering for unrecognized emojis. - Subsequent dispatch: Call Send a message to deliver the sticker message.
Was this page helpful?