SDKsReact Native
Set conversation extension
Store custom application metadata in the conversation ex field using the OpenIM React Native SDK.
Attach or update application-defined metadata in the conversation's ex field:
await OpenIMSDK.setConversation({
conversationID,
ex: JSON.stringify({
category: 'work',
}),
});Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationID | string | Yes | Target conversation ID to update. |
ex | string | No | Custom 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.
Was this page helpful?