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() with the group GUID, a list of GroupMember objects, and an optional list of UIDs to ban.
- Java
- Kotlin
onSuccess() method of the CallbackListener, you will receive a HashMap 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 or ban the user failed.
Real-Time Group Member Added Events
When a member is added to a group, existing members receive a real-time event inonMemberAddedToGroup() of the GroupListener class. The callback provides an Action object, the adding User, the added User, and the Group.
When a member is added by another user,
onMemberAddedToGroup() fires. When a user joins on their own, onGroupMemberJoined() fires instead.- Java
- Kotlin
Member Added to Group event in Message History
When fetching message history, if a member was added to a group the logged-in user is part of, the list will contain anAction message with these fields:
action-addedactionOn-Userobject containing the details of the user who was added to the groupactionBy-Userobject containing the details of the user who added the member to the groupactionFor-Groupobject containing the details of the group to which the member was added
GroupMember Payload Structure
GroupMember Object
GroupMember Object
The
Sample GroupMember Object:
GroupMember object extends User and contains all User fields plus group-specific fields:| Parameter | Type | Description |
|---|---|---|
uid | String | Unique identifier of the user |
name | String | Display name of the user |
avatar | String | URL to user’s profile picture |
link | String | URL to user’s profile page |
role | String | User role for access control |
metadata | JSONObject | Custom data set by developer |
status | String | User online status. Values: "online", "offline" |
statusMessage | String | Custom status message |
lastActiveAt | long | Unix timestamp of last activity |
hasBlockedMe | boolean | Whether this user has blocked the logged-in user |
blockedByMe | boolean | Whether the logged-in user has blocked this user |
tags | Array<String> | List of tags for user identification |
deactivatedAt | long | Unix timestamp when user was deactivated (0 if active) |
scope | String | Member’s scope in the group. Values: "admin", "moderator", "participant" |
joinedAt | long | Unix timestamp when member joined the group |
Next Steps
Kick Member
Remove members from groups
Change Member Scope
Update member roles and permissions
Retrieve Members
Fetch list of group members
Group Listeners
Handle real-time group events