SDKsiOS
Retrieve joined groups
Retrieve every iOS group joined by the current user.
Invoke getJoinedGroupListWithOnSuccess:onFailure: to retrieve a complete snapshot of all groups joined by the currently signed-in user:
Code example
[[OIMManager manager] getJoinedGroupListWithOnSuccess:^(NSArray<OIMGroupInfo *> *groups) {
[self replaceGroups:groups];
} onFailure:^(NSInteger code, NSString *message) {
NSLog(@"getJoinedGroupList failed: %ld %@", (long)code, message);
}];This method requires no business parameters. If the account belongs to a large number of groups, prefer Retrieve joined groups by page to avoid unbounded payloads.
Return value
The onSuccess callback delivers an array of OIMGroupInfo objects (NSArray<OIMGroupInfo *> *) representing all groups joined by the user.
State changes after the call
- Snapshot query: This query retrieves an instantaneous snapshot without triggering delegate callbacks.
- Local cache sync: The client updates or replaces its cached joined group collection using
groupIDas the primary key. - Event notification: Subsequent group joins or departures broadcast via
onJoinedGroupAdded:andonJoinedGroupDeleted:. For listener setup, refer to Groups overview.
Was this page helpful?