Retrieve conversations in a group
Retrieve a conversation group and its conversations by page with Open_im_sdkGetConversationGroupInfoWithConversations.
Use Open_im_sdkGetConversationGroupInfoWithConversations to retrieve a conversation group together with the current page of its conversation details.
Parameters
| Field | Required | Description |
|---|---|---|
conversationGroupID | Yes | The conversation-group ID. |
pagination.pageNumber | Yes | The page number, starting at 1. |
pagination.showNumber | Yes | The 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.
Was this page helpful?