Browse SDKs · React Native
Platform
SDKsReact Native

Set conversation extension

Store custom application metadata in the conversation ex field using the OpenIM React Native SDK.

Copy

Attach or update application-defined metadata in the conversation's ex field:

await OpenIMSDK.setConversation({
  conversationID,
  ex: JSON.stringify({
    category: 'work',
  }),
});

Parameters

ParameterTypeRequiredDescription
conversationIDstringYesTarget conversation ID to update.
exstringNoCustom extension string. Serialize JSON or proprietary structured text as needed.

If you need to preserve existing extension keys, read the current ex property first, merge your mutations in application code, and write back the consolidated string.

Return value

A resolved Promise confirms that the extension field was persisted on the server.

The update triggers the OnConversationChanged event. Use conversationID to identify the conversation in local state and merge the updated ex attribute. For event registration, see Retrieve conversation list.