Browse SDKs · Android
Platform
SDKsAndroid

Get group owners and admins

Use getGroupMemberOwnerAndAdmin to retrieve the group owner and administrator profiles.

Copy

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

ParameterTypeRequiredDescription
baseOnBase<List<GroupMembersInfo>>YesCallback handler for the asynchronous request.
groupIDStringYesGlobally 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

  1. Snapshot retrieval: This is a read-only query that returns the current administrative roster without mutating group state.
  2. Local cache maintenance: Clients should cache and merge administrative members using groupID:userID as the unique key.
  3. Role changes: When administrator roles change, the SDK emits onGroupMemberInfoChanged. To assign or revoke administrator privileges, see Set group member role level.