Skip to main content
Quick Reference for AI Agents & Developers
  • Transfer ownership: CometChat.transferGroupOwnership(UID:GUID:onSuccess:onError:)
  • Permission: Only current group owner can transfer ownership
  • Note: Owner must transfer ownership before leaving the group
  • Related: Leave Group · Change Member Scope · Groups Overview

Transfer Group Ownership

In other words, as a logged-in user, how do I transfer the ownership of any group if I am the owner of the group? In order to transfer the ownership of any group, the first condition is that you must be the owner of the group. In case you are the owner of the group, you can use the transferGroupOwnership() method.
The owner is not allowed to leave the group. If you as the owner would like to leave the group, you will have to transfer your ownership first to any other member of the group and only then you will be allowed to leave the group.

Method Parameters

Request Parameters:Success Response:After Transfer:Error Response (CometChatException):
Request Parameters:Error Response:
Only the current owner can transfer ownership.
Request Parameters:Error Response:

Real-Time Ownership Changed Events

In other words, as a member of a group, how do I know when ownership is transferred? In order to receive real-time events whenever group ownership changes, you will need to implement the onOwnershipChanged() method of the CometChatGroupDelegate.

onOwnershipChanged Parameters

Event Trigger: Received via CometChatGroupDelegate.onOwnershipChanged(group:newOwner:)group (Group Object):newOwner (GroupMember Object):

Missed Ownership Changed Events

In other words, as a member of a group, how do I know when ownership is transferred when my app is not running? When you retrieve the list of previous messages if ownership has been transferred for any group that the logged-in user is a member of, the list of messages will contain an Action message.

Action Message Properties (for missed events)


Common Error Codes