Set conversation extension data
Store custom application metadata on a conversation using setConversationEx().
Attach custom business metadata to a conversation. The extension string is typically a serialized JSON string used to store domain tags, category identifiers, or custom presentation attributes.
Code example
OpenIMClient.getInstance().conversationManager.setConversationEx(
new OnBase<String>() {
@Override
public void onSuccess(String data) {
// Extension update succeeded.
}
@Override
public void onError(int code, String error) {
// code and error describe the failure.
}
},
conversationID,
extensionJSON
);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
base | OnBase<String> | Yes | Callback delivering the asynchronous operation result. |
conversationID | String | Yes | Target conversation identifier. |
ex | String | Yes | Custom extension string, typically formatted as JSON text. |
Return value
The successful callback indicates that the server persisted the extension string. The update synchronizes across all devices logged into the authenticated account.
State changes after the call
Once the extension string takes effect, the SDK triggers the OnConversationListener.onConversationChanged event. When your listener receives this event, locate the conversation matching conversationID and update its ex field. For complete listener registration details, see Get the conversation list.
Was this page helpful?