Documentation Index Fetch the complete documentation index at: https://cometchat-22654f5b-docs-android-v6-beta2.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
AI Integration Quick Reference
// Update group details
let group = Group ( guid : "GUID" , name : "New Name" , groupType : . public , password : nil )
CometChat. updateGroup ( group : group,
onSuccess : { group in }, onError : { error in })
Update a group’s name, icon, description, or metadata. The GUID and group type cannot be changed after creation. See the Group Class reference for all editable fields.
Update Group
Use updateGroup() to modify group details. Pass a Group object with the updated values.
let GUID = "GUID" ;
let groupName = "Hello Group!" ;
let groupType: CometChat.groupType = . public ;
let groupTobeUpdated = Group ( guid : GUID, name : groupName, groupType : groupType, password : nil )
CometChat. updateGroup ( group : groupTobeUpdated, onSuccess : { (group) in
print ( "Groups details updated successfully. " + group. stringValue ())
}) { (error) in
print ( "Group details update failed with error: " + error ! . errorDescription );
}
NSString * guid = @"cometchat-guid-101" ;
NSString * name = @"TestGroup1" ;
NSString * password = nil ; // mandatory in case of password protected group type
NSInteger limit = 30 ;
Group * groupToBeUpdated = [[Group alloc ]initWithGuid:guid name: name groupType: groupTypePublic password: password];
[CometChat updateGroupWithGroup: groupToBeUpdated onSuccess: ^ (Group * group) {
NSLog ( @"Groups details updated successfully. %@ " ,[group stringValue ]);
} onError: ^ (CometChatException * error) {
NSLog ( @"Group details update failed with error: %@ " ,[error errorDescription ]);
}];
Parameter Description groupAn instance of Group class with updated values
On success, returns a Group object with the updated details.
Real-time Events
When a group is updated, all members receive the onGroupUpdated event via CometChatGroupDelegate:
extension YourClass : CometChatGroupDelegate {
func onGroupUpdated ( action : ActionMessage, updatedGroup : Group, updatedBy : User) {
print ( "Group updated: \( updatedGroup. name ?? "" ) " )
print ( "Updated by: \( updatedBy. name ?? "" ) " )
}
}
Next Steps
Delete Group Permanently delete a group
Retrieve Groups Fetch and filter groups with pagination