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
AI Integration Quick Reference
Add Members to Group
UseaddMembersToGroup() to add members to a Group.
| Parameter | Type | Description |
|---|---|---|
guid | String | The GUID of the group to add members to |
groupMembers | List<GroupMember> | List of GroupMember objects (UID and scope required) |
onSuccess | Function(Map<String?, String?>) | Callback with a map of UIDs to result status |
onError | Function(CometChatException) | Callback triggered on failure |
GroupMember class. The UID and the scope of the GroupMember are mandatory.
- Dart
Response
Response
On Success — A
Map<String?, String?> where each key is the UID of the user and the value is either "success" or an error message:| Parameter | Type | Description | Sample Value |
|---|---|---|---|
cometchat-uid-3 | string | Result for the first member added | "success" |
cometchat-uid-4 | string | Result for the second member added | "success" |
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 group GUID." |
onSuccess() callback, you will receive a Map which will contain the UID of the users and the value will either be success or an error message describing why the operation to add the user to the group failed.
Real-Time Group Member Added Events
When a group member is added by another member, this event is triggered. When a user joins a group on their own, the joined event is triggered.
onMemberAddedToGroup() in GroupListener to receive real-time notifications when members are added.
- Dart
| Callback Parameter | Type | Description |
|---|---|---|
action | Action | The action object containing details of the event |
addedby | User | The user who added the member |
userAdded | User | The user who was added to the group |
addedTo | Group | The group the member was added to |
Missed Member Added Events
When you retrieve the list of previous messages, if a member has been added to 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 added event, in the Action object received, the following fields can help you get the relevant information:
Next Steps
Kick & Ban Members
Remove or ban members from a group
Change Member Scope
Promote or demote group members
Retrieve Group Members
Fetch the list of members in a group
Join a Group
Allow users to join public or password-protected groups