Skip to main content

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.

// Update a group
Group group = Group(guid: "GROUP_ID", name: "New Name", type: CometChatGroupType.public);
group.description = "Updated description";
group.icon = "https://example.com/icon.png";

await CometChat.updateGroup(
  group: group,
  onSuccess: (Group group) => debugPrint("Updated: ${group.name}"),
  onError: (CometChatException e) => debugPrint("Error: ${e.message}"),
);
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

In other words, as a group owner, how can I update the group details? You can update the existing details of the group using the updateGroup() method. Pass a Group object with the updated values.
Available via: SDK | REST API | UI Kits

Parameters

ParameterTypeDescription
groupGroupAn instance of the Group class with updated values
onSuccessFunction(Group group)?Callback triggered on successful group update
onErrorFunction(CometChatException excep)?Callback triggered on error
String GUID = "GUID";
  String groupName = "Hello Group!";
  String groupType = CometChatGroupType.public;
  String password = "";

  Group _group = Group(guid: GUID, name: groupName, type: groupType);


  await CometChat.updateGroup(group: _group, onSuccess: (Group group ){
    debugPrint("Group Created Successfully : $group ");
  }, onError:(CometChatException e) {
    debugPrint("Group Creation failed with exception: ${e.message}");
  } );   
On Success — A Group object containing all details of the updated group:Group Object:
ParameterTypeDescriptionSample Value
guidstringUnique identifier for the group"cometchat-guid-1"
namestringDisplay name of the group"Hello Group!"
iconstringURL of the group iconnull
descriptionstringDescription of the groupnull
membersCountnumberNumber of members in the group5
metadataobjectCustom metadata attached to the group{}
joinedAtnumberEpoch timestamp when the logged-in user joined the group1745554729
hasJoinedbooleanWhether the logged-in user has joined the grouptrue
createdAtnumberEpoch timestamp when the group was created1745554729
ownerstringUID of the group owner"cometchat-uid-1"
updatedAtnumberEpoch timestamp when the group was last updated1745554800
tagsarrayList of tags associated with the group[]
typestringType of the group (public, private, password)"public"
scopestringScope of the logged-in user in the group"admin"
passwordstringPassword for password-protected groupsnull
isBannedFromGroupbooleanWhether the logged-in user is banned from the groupfalse
ParameterTypeDescriptionSample Value
codestringError code identifier"ERR_GUID_NOT_FOUND"
messagestringHuman-readable error message"The specified group does not exist."
detailsstringAdditional technical details"Please provide a valid GUID for the group."
After the successful update of the group, you will receive an instance of Group class containing updated information of the group. For more information on the Group class, please check here.
There is no real-time event listener for group updates. To get the latest group information after calling updateGroup(), fetch the group details again using getGroup().

Next Steps

Delete Group

Permanently delete a group

Retrieve Groups

Fetch and filter groups with pagination

Create Group

Create new public, private, or password-protected groups

Groups Overview

Overview of all group management features