Browse SDKs · iOS
Platform
SDKsiOS

Retrieve joined groups by page

Retrieve groups joined by the current user with pagination on iOS.

Copy

Invoke getJoinedGroupListPageWithOffset:count:onSuccess:onFailure: to retrieve groups joined by the current user with pagination:

Parameters

ParameterTypeRequiredDescription
offsetNSIntegerYesPagination offset index; pass 0 for the initial page.
countNSIntegerYesNumber 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

  1. Snapshot query: This method retrieves an instantaneous paginated slice without triggering group delegate callbacks.
  2. Local pagination merge: When loading more items, increment offset by the count of received records and merge items idempotently using groupID.
  3. Event notification: Subsequent additions or removals of joined groups broadcast via onJoinedGroupAdded: and onJoinedGroupDeleted:. For listener setup, refer to Groups overview.