Overview
In-call chat creates a group conversation linked to the call session. When participants tap the chat button, they can:- Send and receive text messages
- Share images, files, and media
- See message history from the current call
- Get unread message notifications via badge count
Prerequisites
- CometChat Calls SDK integrated (Setup)
- CometChat Chat SDK integrated (Chat SDK)
- CometChat UI Kit integrated (UI Kit)
The Chat SDK and UI Kit are separate from the Calls SDK. You’ll need to add both dependencies to your
pubspec.yaml.Step 1: Add UI Kit Dependency
Add the CometChat UI Kit to yourpubspec.yaml:
Step 2: Enable Chat Button
Configure session settings to show the chat button:Step 3: Create Chat Group
Create or join a CometChat group using the session ID as the group GUID. This links the chat to the specific call session.Step 4: Handle Chat Button Click
Listen for the chat button click and navigate to your chat screen:Step 5: Track Unread Messages
Listen for incoming messages and update the badge count on the chat button:Remember to remove the message listener in
dispose() to prevent memory leaks:Step 6: Create Chat Screen
Create a chat screen using UI Kit components:Complete Example
Here’s the complete call screen with in-call chat integration:Related Documentation
- UI Kit Overview - CometChat UI Kit components
- Button Click Listener - Handle button clicks
- SessionSettingsBuilder - Configure chat button visibility