SDKsAndroid
Create a custom message
Use createCustomMessage to carry application-defined JSON content.
Your application defines data, extension, and description. Receiving clients must parse them according to the same application protocol.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
data | String | Yes | Custom message body, normally a validated JSON string. |
extension | String | Yes | Application extension data; pass an empty string when unused. |
description | String | Yes | Short description for notifications and conversation summaries. |
Message message = OpenIMClient.getInstance().messageManager.createCustomMessage(
dataJson, extensionJson, description);The returned Message is only a local pending object. Validate the protocol version and field sizes before sending, and never place tokens, secrets, or other sensitive values in custom data. Continue with Send a message.
Was this page helpful?