Transfer group ownership
Transfer group ownership to another member with the OpenIM Flutter SDK.
Only the current owner can call transferGroupOwner(), and the target user must be a valid group member.
Both groupID, the target group ID, and userID, the new owner's user ID, are required non-empty strings:
await OpenIM.iMManager.groupManager.transferGroupOwner(
groupID: groupID,
userID: targetUserID,
);State after the call
A successful Future means that OpenIMServer completed the transfer: the previous owner becomes a regular member and the new owner receives the owner role. Their changes may arrive as separate onGroupMemberInfoChanged events, so one transfer can update two member records. Merge both by groupID:userID.
For complete listening and merge rules, see Group member queries overview. Do not infer the result solely from the number of listener events. When displaying the current owner and administrator list, query getGroupOwnerAndAdmin() again.
An owner who wants to leave must transfer ownership before calling the leave-group API. The owner can instead dismiss an unneeded group, but dismissal affects every member and does not replace an ordinary transfer.
Was this page helpful?