SDKsAndroid
Get group owners and admins
Use getGroupMemberOwnerAndAdmin to retrieve the group owner and administrator profiles.
Retrieve member profile records for the group owner and all group administrators in a specified group. This is typically used for group settings displays, permission checks, and administrative approval workflows.
Code example
String groupID = "group_123";
OpenIMClient.getInstance().groupManager.getGroupMemberOwnerAndAdmin(
new OnBase<List<GroupMembersInfo>>() {
@Override
public void onSuccess(List<GroupMembersInfo> members) {
// members contains profiles for the group owner and all administrators
}
@Override
public void onError(int code, String error) {
// Failed to retrieve administrative members
}
},
groupID
);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
base | OnBase<List<GroupMembersInfo>> | Yes | Callback handler for the asynchronous request. |
groupID | String | Yes | Globally unique ID of the target group. |
Return value
Upon success, onSuccess returns a list of administrative member profiles (List<GroupMembersInfo>).
Administrative roles can be distinguished by roleLevel: 100 (GroupRole.OWNER) represents the group owner, and 60 (GroupRole.ADMIN) represents an administrator.
State changes after the call
- Snapshot retrieval: This is a read-only query that returns the current administrative roster without mutating group state.
- Local cache maintenance: Clients should cache and merge administrative members using
groupID:userIDas the unique key. - Role changes: When administrator roles change, the SDK emits
onGroupMemberInfoChanged. To assign or revoke administrator privileges, see Set group member role level.
Was this page helpful?