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

Add conversations to groups

OpenIM uni-app / uni-app x SDK guide for Add conversations to groups.

Copy

addConversationsToGroups() Commercial updates membership using explicit sets of conversation IDs and group IDs.

Parameters

ParameterTypeRequiredDescription
conversationIDsstring[]YesConversations to add.
conversationGroupIDsstring[]YesTarget groups. Every conversation is added to every target group.
import { addConversationsToGroups } from '@/uni_modules/unix-openim-sdk'

await addConversationsToGroups({
  conversationIDs: [conversationID],
  conversationGroupIDs: ['group_a'],
})

Both arrays must be non-empty. Remove blank values and duplicates before calling. One conversation can belong to several groups; this operation does not alter its messages or remove its other group memberships.

Return result

The Promise resolves directly to Core's string result, meaning the membership request completed. It does not mean that the local group-member event has arrived. Confirm final membership through onConversationGroupMemberAdded or a new query, and never retain a local-only membership after failure. See Conversation groups overview for the complete raw-event handling.