AI Integration Quick Reference
AI Integration Quick Reference
Join a Group
UsejoinGroup() to start participating in a group conversation.
- Java
- Kotlin
joinGroup() method takes the following parameters:
Once you have joined a group successfully, you can send and receive messages in that group.
CometChat keeps track of the groups you have joined, so you do not need to join the group every time you want to communicate in it.
You can identify if a group is joined using the
hasJoined parameter in the Group object.
Real-Time Group Member Joined Events
When a user joins a group, members receive a real-time event inonGroupMemberJoined() of the GroupListener class. The callback provides an Action object, the joined User, and the Group.
- Java
- Kotlin
Missed Group Member Joined Events
When fetching message history, if a member joined a group the logged-in user is part of, the list will contain anAction message with these fields:
action-joinedactionBy-Userobject containing the details of the user who joined the groupactionFor-Groupobject containing the details of the group the user has joined
Next Steps
Leave Group
Leave groups you no longer want to participate in
Retrieve Members
Fetch list of group members
Send Messages
Start sending messages in the group
Group Listeners
Handle real-time group events