Get conversations in a group
Query detailed metadata and paginated conversation items within a specific conversation group.
Retrieving conversation group details is a Commercial Edition capability. Query a conversation group along with its member conversations using page-based pagination.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationGroupID | string | Yes | Identifier of the target conversation group. |
pagination.pageNumber | number | Yes | Page number starting from 1. |
pagination.showNumber | number | Yes | Number of conversation items to fetch per page. |
Code example
import { getConversationGroupInfoWithConversations } from '@/uni_modules/unix-openim-sdk'
const result = await getConversationGroupInfoWithConversations({
conversationGroupID,
pagination: {
pageNumber: 1,
showNumber: 20,
},
})
if (result != null) {
renderConversationGroup(
result.conversationGroup,
result.conversations,
result.ConversationTotal ?? 0,
)
}Return value
The Promise resolves with an OpenIMConversationGroupInfoWithConversationsResult | null object:
| Field | Type | Description |
|---|---|---|
conversationGroup | OpenIMConversationGroupItem | null | Metadata of the requested conversation group. |
ConversationTotal | number | null | Total count of conversations in this group; note the initial capital letter. |
conversations | OpenIMConversationItem[] | Array of conversation items for the requested page. |
Determine whether pagination is exhausted by comparing the accumulated loaded items against ConversationTotal.
State changes after the call
This call returns a point-in-time snapshot and does not trigger events. Merge group metadata using conversationGroupID and conversation items using conversationID. When conversation group events arrive, reset the pagination offset and re-query as outlined in Conversation group overview.
Was this page helpful?