Documentation Index
Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
AI Integration Quick Reference
AI Integration Quick Reference
CometChatGroupType.public | CometChatGroupType.password | CometChatGroupType.privateJoin a Group
UsejoinGroup() to join a group.
Parameters
| Parameter | Type | Description |
|---|---|---|
guid | String | The GUID of the group to join |
groupType | String | CometChatGroupType.public, CometChatGroupType.password, or CometChatGroupType.private |
password | String | Required for password-protected groups (defaults to empty string) |
onSuccess | Function(Group group)? | Callback triggered on successful join |
onError | Function(CometChatException excep)? | Callback triggered on error |
- Dart
Response
Response
On Success — A
Group object containing all details of the joined group:Group Object:| Parameter | Type | Description | Sample Value |
|---|---|---|---|
guid | string | Unique identifier for the group | "cometchat-guid-1" |
name | string | Display name of the group | "Hello Group!" |
icon | string | URL of the group icon | null |
description | string | Description of the group | null |
membersCount | number | Number of members in the group | 5 |
metadata | object | Custom metadata attached to the group | {} |
joinedAt | number | Epoch timestamp when the logged-in user joined the group | 1745554729 |
hasJoined | boolean | Whether the logged-in user has joined the group | true |
createdAt | number | Epoch timestamp when the group was created | 1745551200 |
owner | string | UID of the group owner | "cometchat-uid-1" |
updatedAt | number | Epoch timestamp when the group was last updated | 1745554729 |
tags | array | List of tags associated with the group | [] |
type | string | Type of the group (public, private, password) | "public" |
scope | string | Scope of the logged-in user in the group | "participant" |
password | string | Password for password-protected groups | null |
isBannedFromGroup | boolean | Whether the logged-in user is banned from the group | false |
Error
Error
| Parameter | Type | Description | Sample Value |
|---|---|---|---|
code | string | Error code identifier | "ERR_GUID_NOT_FOUND" |
message | string | Human-readable error message | "The specified group does not exist." |
details | string | Additional technical details | "Please provide a valid GUID for the group." |
hasJoined on the Group object to verify membership.
Real-time Group Member Joined Events
In other words, as a member of a group, how do I know if someone joins the group when my app is running? If a user joins any group, the members of the group receive a real-time event in theonGroupMemberJoined() method of the GroupListener class.
- Dart
Missed Group Member Joined Events
In other words, as a member of a group, how do I know if someone joins the group when my app is not running? When you retrieve the list of previous messages if a member has joined any group that the logged-in user is a member of, the list of messages will contain anAction message. An Action message is a sub-class of BaseMessage class.
For the group member joined event, in the Action object received, the following fields can help you get the relevant information-
action-joinedactionBy- User object containing the details of the user who joined the groupactionFor- Group object containing the details of the group the user has joined
Next Steps
Leave a Group
Allow members to leave a group
Retrieve Group Members
Fetch the list of members in a group
Send Messages
Send messages to group conversations
Add Members
Programmatically add members to a group