Browse SDKs · uni-app / uni-app x
SDKsuni-appEnterprise

Create a conversation group

OpenIM uni-app / uni-app x SDK guide for Create a conversation group.

Copy

createConversationGroup() Commercial creates a custom group and can add one initial conversation.

Parameters

ParameterTypeRequiredDescription
namestringYesGroup name. Validate blank values and length according to product rules.
ordernumberYesSort value. Use one consistent direction throughout the product.
conversationGroupTypeOpenIMConversationGroupTypeYesGroup type allowed by the plugin contract.
conversationIDstring or nullNoInitial conversation added during creation.
exstring or nullNoExtension 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?.conversationGroup

Return 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.