SDKsuni-app
Set conversation extra data
OpenIM uni-app / uni-app x SDK guide for Set conversation extra data.
Use setConversation() to replace a conversation's application ex string.
import { setConversation } from '@/uni_modules/unix-openim-sdk'
await setConversation({ conversationID, ex: JSON.stringify({ color: 'blue' }) })ex is a complete replacement, not a partial merge. Read the current string, validate its versioned business schema, merge the namespaces owned by the application, and preserve unknown fields before writing. Never store tokens, secrets, private message bodies, or server-only data.
Promise success means that the update request completed. Confirm final state through onConversationChanged or a new query. If an old schema or unknown field cannot be parsed, preserve the original string and degrade the UI rather than overwriting it.
Was this page helpful?