Browse SDKs · Android
Platform
SDKsAndroid

Transfer group ownership

Use the Android SDK to transfer group ownership to a specified member.

Copy

Transfer group ownership to another member in the group. After the transfer succeeds, the original owner becomes a regular group member, and the new owner gains full administrative control, including the authority to dismiss the group.

Code example

String groupID = "group_123";
String newOwnerUserID = "user_b";

OpenIMClient.getInstance().groupManager.transferGroupOwner(
    new OnBase<String>() {
        @Override
        public void onSuccess(String data) {
            // Group ownership transferred successfully
        }

        @Override
        public void onError(int code, String error) {
            // Failed to transfer group ownership
        }
    },
    groupID,
    newOwnerUserID
);

Parameters

ParameterTypeRequiredDescription
baseOnBase<String>YesCallback handler for the asynchronous request.
groupIDStringYesGlobally unique ID of the target group.
newOwnerUserIDStringYesUser ID of the new owner. The user must already be an existing member of the group.

Return value

Upon success, data in onSuccess returns a confirmation message.

State changes after the call

  1. Callback confirmation: The onSuccess callback indicates that the group ownership transition has been committed on the server.
  2. Asynchronous event delivery: Members in the group receive synchronization events:
  3. onGroupMemberInfoChanged: Delivered for both the former owner and the new owner with their updated roleLevel values. Merge using groupID:userID.
  4. onGroupInfoChanged: Delivers the updated GroupInfo reflecting the new ownerUserID. Merge using groupID.
  5. Re-query calibration: To calibrate administrative roles or group details, call Get group owners and admins or Get group profiles.

For complete listener registration and lifecycle management, see Group overview.