SDKsiOS
Retrieve the group owner and administrators
Retrieve the owner and administrators of an iOS group.
Invoke getGroupMemberOwnerAndAdmin:onSuccess:onFailure: to quickly query the group owner and all administrators:
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupID | NSString * | Yes | Target group ID. |
Code example
[[OIMManager manager] getGroupMemberOwnerAndAdmin:@"group_1001"
onSuccess:^(NSArray<OIMGroupMemberInfo *> *members) {
[self replaceOwnerAndAdmins:members];
}
onFailure:^(NSInteger code, NSString *message) {
NSLog(@"getGroupMemberOwnerAndAdmin failed: %ld %@", (long)code, message);
}];Return value
The onSuccess callback delivers an array of OIMGroupMemberInfo models (NSArray<OIMGroupMemberInfo *> *) containing the group owner and all active administrators.
State changes after the call
- Management snapshot: This method provides a direct way to render the group administration team without traversing or paginating through the full member roster.
- Event notification: Role changes and ownership transfers broadcast via
onGroupMemberInfoChanged:. The client updates the corresponding member record matchinggroupID:userID. For listener setup, refer to Group member queries overview.
Was this page helpful?