Quick Reference for AI Agents & Developers
- Join group:
CometChat.joinGroup(GUID:groupType:password:onSuccess:onError:) - Public groups: No password required
- Password groups: Password required
- Private groups: Cannot join directly — must be added by admin/owner
- Related: Create Group · Leave Group · Groups Overview
Join a Group
In order to start participating in group conversations, you will have to join a group. You can do so using thejoinGroup() method.
Join Group Parameters
Group Type Behavior
- Swift
- Objective C
Sample Payload - Join Public Group
Sample Payload - Join Public Group
Request Parameters:
Success Response (Group Object):
Success Response Properties After Join:
Error Response (CometChatException):
Sample Payload - Join Password Group
Sample Payload - Join Password Group
Sample Payload - Join Private Group (Error)
Sample Payload - Join Private Group (Error)
Request Parameters:
Error Response:
Real-time Group Member Joined Events
In other words, as a recipient, how do I know when someone joins a group? To receive Real-Time Events for the same, you need to implement theonGroupMemberJoined() method of the CometChatGroupDelegate.
- Swift
- Objective C
Sample Payload - onGroupMemberJoined Event
Sample Payload - onGroupMemberJoined Event
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: