AI Integration Quick Reference
AI Integration Quick Reference
Overview
When the user taps a call, the details screen shows:- The call: its direction — incoming, outgoing or missed — its date and its duration.
- Participants: who was in the call, and for how long.
- Recording: the call’s recordings, to play or download.
- History: every call with that user, or in that group.
CometChatCallLogDetails, in both toolkits.
Prerequisites
- The Kit installed, initialised with calling on —
CometChatSession.initialize(appID:region:enableCalling: true)— and a user logged in. See Calling Integration. NSMicrophoneUsageDescriptionandNSCameraUsageDescriptioninInfo.plist, for the call buttons on the details screen.
Components
Integration Steps
1. Show the Call Log
- SwiftUI
- UIKit
Put the list in your
NavigationStack, so a row can push the details:CallsTab.swift
2. Add It as a Tab
- SwiftUI
- UIKit
Use the
CallsTab from step 1 where this shows the bare list:HomeView.swift
NavigationStack in SwiftUI unless you pass embedsNavigationStack: false.
3. What the Details Screen Shows
CometChatCallLogDetails(callLog:) needs nothing else. It shows a header for the call’s user
or group with voice and video buttons, a card with the call’s direction, date and duration,
and three swipeable tabs:
Implementation Flow
CometChatCallLogsfetches the call log, 30 rows a page, and keeps it fresh: pull-to-refresh, a call ending, a reconnect.- The user taps a row → your handler pushes
CometChatCallLogDetailswith thatChatCallLog. - The details screen fetches the call’s user or group for its header, and the History tab’s first page.
- The header’s buttons, or a call log row’s call-back button, place a new call.
Customization Options
- SwiftUI
- UIKit
headerView in SwiftUI, or configure messageHeader in UIKit.
Filtering & Edge Cases
- Missed calls only: pass
CallLogsQuery(direction: .missed)—callLogRequestBuilderin SwiftUI,set(callRequestBuilder:)in UIKit. - Calls with recordings:
CallLogsQuery(hasRecording: true). - No recordings: the Recording tab shows “No Call Recordings” — it is never hidden.
- Group calls: the call log’s call-back button is hidden on group rows; the details header’s buttons start a group meeting.
- SwiftUI
- UIKit
Error Handling
- SwiftUI
- UIKit
onError hears a failed lookup of the user or group, and a failed History page — whose tab
then shows “Oops!” and Retry. On the call log, onError and onEmpty cover the list.
Summary / Feature Matrix
Call Logs
Every option of the call log
Call Log Details
Every option of the details screen