SDKsiOS
Retrieve joined groups by page
Retrieve groups joined by the current user with pagination on iOS.
Invoke getJoinedGroupListPageWithOffset:count:onSuccess:onFailure: to retrieve groups joined by the current user with pagination:
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
offset | NSInteger | Yes | Pagination offset index; pass 0 for the initial page. |
count | NSInteger | Yes | Number of group items to fetch per page. |
Code example
[[OIMManager manager] getJoinedGroupListPageWithOffset:0
count:50
onSuccess:^(NSArray<OIMGroupInfo *> *groups) {
[self replaceFirstPage:groups];
}
onFailure:^(NSInteger code, NSString *message) {
NSLog(@"getJoinedGroupListPage failed: %ld %@", (long)code, message);
}];Return value
The onSuccess callback delivers an array of OIMGroupInfo objects (NSArray<OIMGroupInfo *> *) representing the requested page.
State changes after the call
- Snapshot query: This method retrieves an instantaneous paginated slice without triggering group delegate callbacks.
- Local pagination merge: When loading more items, increment
offsetby the count of received records and merge items idempotently usinggroupID. - Event notification: Subsequent additions or removals of joined groups broadcast via
onJoinedGroupAdded:andonJoinedGroupDeleted:. For listener setup, refer to Groups overview.
Was this page helpful?