Browse SDKs · Android
SDKsAndroid

Transfer group ownership

Use transferGroupOwner to transfer group ownership to a specified member.

Copy

transferGroupOwner() accepts two parameters: groupID, the ID of the group whose ownership is being transferred, and newOwnerUserID, the ID of the new owner. The target user must already be a member of the group.

OpenIMClient.getInstance().groupManager.transferGroupOwner(new OnBase<String>() {
    @Override public void onSuccess(String data) { /* The request completed. */ }
    @Override public void onError(int code, String error) { /* code and error describe the failure. */ }
}, groupID, newOwnerUserID);

After the transfer succeeds, you can call Get group owners and admins again to retrieve the latest profiles.