Set a message's local extension
Update a message's local extension field on the current Flutter device.
Set a device-local custom extension string on a single message (such as UI accordion toggle states or local parsing flags):
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationID | String | Yes | ID of the conversation containing the message. |
clientMsgID | String | Yes | Target client message ID. |
localEx | String | Yes | Device-local custom extension payload, typically encoded as a JSON string. |
Code example
await OpenIM.iMManager.messageManager.setMessageLocalEx(
conversationID: conversationID,
clientMsgID: clientMsgID,
localEx: jsonEncode({'expanded': true}),
);The localEx payload replaces the entire string value; the SDK does not perform incremental merge operations. Ensure clientMsgID is non-empty before calling.
Return value
Future completion indicates that the local extension string was successfully written to the local database on the current device. Update your UI state using the composite key conversationID:clientMsgID.
State changes after the call
This operation performs a device-local data update only. It is not uploaded to the server, does not synchronize to other devices or chat participants, and does not trigger message event notifications.
Was this page helpful?