Transfer group owner
Transfer group ownership to another member in an OpenIM group using the Flutter SDK.
The current group owner can transfer ownership to another member of the group. The target user must be an active member of this group:
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
groupID | String | Yes | Target group ID. |
userID | String | Yes | User ID of the member who will assume group ownership. |
Code example
await OpenIM.iMManager.groupManager.transferGroupOwner(
groupID: groupID,
userID: targetUserID,
);Return value
A successful Future indicates that the ownership transfer has been committed by the server: the previous owner transitions to a regular member, and the target member becomes the new owner.
State changes after the call
Upon success, connected clients receive member profile update events (such as onGroupMemberInfoChanged). A transfer triggers updates for two member records (the former owner and the new owner); update both records using groupID:userID as the key. For complete listener integration, see Retrieving group members overview. To reload the leadership roster, call Get group owner and admin.
If the owner wishes to leave the group, transfer ownership first, then call Quit a group. To disband the group entirely, see Dismiss a group.
Was this page helpful?