SDKsAndroid
Transfer group ownership
Use the Android SDK to transfer group ownership to a specified member.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
base | OnBase<String> | Yes | Callback handler for the asynchronous request. |
groupID | String | Yes | Globally unique ID of the target group. |
newOwnerUserID | String | Yes | User 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
- Callback confirmation: The
onSuccesscallback indicates that the group ownership transition has been committed on the server. - Asynchronous event delivery: Members in the group receive synchronization events:
onGroupMemberInfoChanged: Delivered for both the former owner and the new owner with their updatedroleLevelvalues. Merge usinggroupID:userID.onGroupInfoChanged: Delivers the updatedGroupInforeflecting the newownerUserID. Merge usinggroupID.- 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.
Was this page helpful?