Quick Reference for AI Agents & Developers
- Update group:
CometChat.updateGroup(group:onSuccess:onError:) - Updatable fields: name, description, icon, metadata, tags
- Permission: Only group owner or admin can update
- Related: Create Group · Delete Group · Groups Overview
Update Group
In other words, as a group owner, how can I update the group details? You can update the existing details of the group using theupdateGroup() method.
- Swift
- Objective C
Group class as a parameter that should contain the data that you wish to update.
After a successful update of the group, you will receive an instance of the
Group class containing update information of the group.
Sample Payload - updateGroup() Request
Sample Payload - updateGroup() Request
Method Signature:
Group Object (Input):
Updatable Properties:
Non-Updatable Properties:
Prerequisites:
Sample Payload - updateGroup() Success Response
Sample Payload - updateGroup() Success Response
Success Callback Parameter:
Updated Group Object:
GroupType Enum Values:
MemberScope Enum Values:
Real-time Event Triggered:
Sample Payload - updateGroup() Error Response
Sample Payload - updateGroup() Error Response
Error Callback Parameter:
CometChatException Object:
Common Error Codes:
Error Response Example (Not a Member):
Error Response Example (Permission Denied):
Error Response Example (Group Not Found):
Sample Payload - getGroup() Request (Pre-Update Fetch)
Sample Payload - getGroup() Request (Pre-Update Fetch)
Method Signature:
Request Parameters:
Use Case:
Sample Payload - getGroup() Error Response
Sample Payload - getGroup() Error Response
Error Callback Parameter:
Error Response Example:
Common getGroup() Error Codes:
Real-time Events
When a group is updated, all members receive theonGroupUpdated event via CometChatGroupDelegate:
- Swift
Sample Payload - onGroupUpdated Event
Sample Payload - onGroupUpdated Event