Get groups for a conversation
Query all conversation groups associated with a specific conversation ID.
Querying group associations is a Commercial Edition capability. A single conversation can belong to multiple conversation groups simultaneously. Invoke getConversationGroupByConversationID() to retrieve the complete list of group objects containing the specified conversation.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationID | string | Yes | Identifier of the conversation whose group memberships are being queried. |
Code example
import { getConversationGroupByConversationID } from '@/uni_modules/unix-openim-sdk'
const result = await getConversationGroupByConversationID({
conversationID,
})
const groups = result?.conversationGroups ?? []Ensure conversationID is an OpenIM conversation session ID, not a group chat groupID. When building group ID lists, extract non-null conversationGroupID values from the returned items.
Return value
The Promise resolves with an OpenIMGetConversationGroupByConversationIDResult | null object. The assigned groups are stored in conversationGroups (OpenIMConversationGroupItem[]).
State changes after the call
This call returns a point-in-time snapshot and does not trigger events. When conversation group member assignments change, re-query the group list and merge results by conversationGroupID as documented in Conversation group overview.
Was this page helpful?