AI Integration Quick Reference
AI Integration Quick Reference
CometChatGroupType.public | CometChatGroupType.password | CometChatGroupType.privateJoin a Group
UsejoinGroup() to join a group.
Parameters
- Dart
Response
Response
On Success — A
Group object containing all details of the joined group:Group Object:Error
Error
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