SDKsuni-appEnterprise
Create a conversation group
OpenIM uni-app / uni-app x SDK guide for Create a conversation group.
createConversationGroup() Commercial creates a custom group and can add one initial conversation.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Group name. Validate blank values and length according to product rules. |
order | number | Yes | Sort value. Use one consistent direction throughout the product. |
conversationGroupType | OpenIMConversationGroupType | Yes | Group type allowed by the plugin contract. |
conversationID | string or null | No | Initial conversation added during creation. |
ex | string or null | No | Extension string. It is a complete value and is not merged as JSON. |
import { createConversationGroup } from '@/uni_modules/unix-openim-sdk'
const result = await createConversationGroup({
name: 'Priority',
order: 100,
conversationGroupType: 0,
conversationID,
ex: '',
})
const group = result?.conversationGroupReturn result
The Promise resolves directly to OpenIMCreateConversationGroupResult or null. Its conversationGroup is the new snapshot and can itself be null; add it to the local index only after validating a non-empty conversationGroupID.
Promise completion and onConversationGroupAdded are separate stages. Requery after the raw event to reconcile the final list. If conversationID was provided, reconcile that membership from the query as well.
Was this page helpful?