Browse SDKs · iOS
SDKsiOSEnterprise

Retrieve conversations in a group

Retrieve a conversation group and its conversations by page with Open_im_sdkGetConversationGroupInfoWithConversations.

Copy

Use Open_im_sdkGetConversationGroupInfoWithConversations to retrieve a conversation group together with the current page of its conversation details.

Parameters

FieldRequiredDescription
conversationGroupIDYesThe conversation-group ID.
pagination.pageNumberYesThe page number, starting at 1.
pagination.showNumberYesThe number of items per page.
NSDictionary *request = @{
    @"conversationGroupID": conversationGroupID,
    @"pagination": @{ @"pageNumber": @1, @"showNumber": @20 },
};
NSData *requestData = [NSJSONSerialization dataWithJSONObject:request options:0 error:nil];
NSString *requestJSON = [[NSString alloc] initWithData:requestData
                                              encoding:NSUTF8StringEncoding];

Pass your callback and requestJSON to Open_im_sdkGetConversationGroupInfoWithConversations.

Result

The response JSON provides group, the current page's conversationElems, and isEnd. The iOS Core response does not contain conversationTotal. Determine when pagination has finished from isEnd; do not apply the total-count field used by the WASM SDK.

This query does not trigger the conversation-group listener. If changes occur during pagination, query again afterward to reconcile the snapshot.