AI Integration Quick Reference
AI Integration Quick Reference
How It Works
The feature is built intoCometChatMessageList. When a user selects “Message Privately” from the message long-press menu:
- The UIKit fetches the message sender via
CometChat.getUser() - It emits an
openChatUI event with{ user }viaCometChatUIEventHandler - Your app listens with
addUIListenerand navigates to a private chat screen
Components
Integration Steps
1. Group Chat Screen
Render the full group chat and register anopenChat listener. The “Message Privately” option appears automatically in the long-press menu for messages sent by other members of a group conversation — no extra setup needed. When selected, the UIKit fetches the sender and fires openChat, which your listener catches to navigate to the private chat.
2. Private Chat Screen
Create a dedicated screen for the private conversation. Include a back button in the header so the user can return to the group.3. Navigation Setup
Register both screens in your navigator.Hiding the Option
The option is already absent in 1:1 conversations, on your own messages, and in AI agent chats — you don’t need to hide it in those cases. UsehideMessagePrivatelyOption when you want to suppress it in a group screen that would otherwise show it — for example a broadcast or announcement group where members shouldn’t DM each other, or a moderated support group where private contact is off-policy.
Feature Matrix
Next Steps
Message List
Full prop reference for CometChatMessageList.
Group Members
Display and manage group member lists.
Message Header
Customize the chat header with back navigation.
All Guides
Browse all feature and formatter guides.