Browse SDKs · Android
SDKsAndroid

Set conversation extra data

Use setConversationEx() to set a conversation extension string.

Copy

ex is a string for storing conversation extension data. You can pass a JSON string or another string format defined by your application.

OpenIMClient.getInstance().conversationManager.setConversationEx(
    new OnBase<String>() {
        @Override
        public void onSuccess(String data) {
            // The request completed.
        }

        @Override
        public void onError(int code, String error) {
            // code and error describe the failure.
        }
    },
    conversationID,
    extensionJSON
);

Conversation list changes for the extension field can be received through onConversationChanged; see Get the conversation list for listener setup.