> ## Documentation Index
> Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Call Log Details

> Build a Calls tab with the CometChat iOS UI Kit v6: the call log, and a details screen with each call's participants, recordings and history.

> [accordion] AI Integration Quick Reference
>
> | Field | Value |
> | - | - |
> | Products | `CometChatSwiftUI` · `CometChatUIKit` |
> | Key components | `CometChatCallLogs`, `CometChatCallLogDetails`, `CallLogsQuery`, `CallLogDetailsStore` |
> | Purpose | A Calls tab: the call log, and a details screen with a call's direction, duration, participants, recordings and history. |
> | Related | [Call Logs](https://www.cometchat.com/docs/ui-kit/ios/v6/call-logs.md), [Call Log Details](https://www.cometchat.com/docs/ui-kit/ios/v6/call-log-details.md), [Call Buttons](https://www.cometchat.com/docs/ui-kit/ios/v6/call-buttons.md) |

Build a Calls tab in your iOS app: the user's call log, and a details screen for any call in
it — for support, moderation and post-call review.

## 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.

The Kit ships the details screen as `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](https://www.cometchat.com/docs/ui-kit/ios/v6/calling-integration.md).
* `NSMicrophoneUsageDescription` and `NSCameraUsageDescription` in `Info.plist`, for the call
  buttons on the details screen.

## Components

| Component | Role |
| - | - |
| `CometChatCallLogs` | the call log — the Calls tab's root |
| `CometChatCallLogDetails` | the details screen, pushed from a row |
| `ChatCallLog` | one row, as both screens take it |
| `CallLogsQuery` | what the call log lists |
| `CallLogDetailsStore` | the details screen's data — the user or group, and the History pages |

## Integration Steps

### 1. Show the Call Log

> [tab] SwiftUI
>
> Put the list in your `NavigationStack`, so a row can push the details:
>
> ```swift CallsTab.swift theme={null}
> struct CallsTab: View {
>     @State private var opened: ChatCallLog?
>
>     var body: some View {
>         NavigationStack {
>             CometChatCallLogs(embedsNavigationStack: false, onItemClick: { opened = $0 })
>                 .navigationDestination(isPresented: Binding(get: { opened != nil },
>                                                             set: { if !$0 { opened = nil } })) {
>                     if let opened { CometChatCallLogDetails(callLog: opened) }
>                 }
>         }
>     }
> }
> ```

> [tab] UIKit
>
> A row tap looks up the call's user or group, then calls `goToCallLogDetail` — push the
> details from there:
>
> ```swift CallsViewController.swift theme={null}
> enum CallsCoordinator {
>     @MainActor static func makeCallLogs() -> CometChatCallLogs {
>         let calls = CometChatCallLogs()
>         calls.set(goToCallLogDetail: { [weak calls] callLog, _, _ in
>             let details = CometChatCallLogDetails(callLog: callLog)
>             details.hidesBottomBarWhenPushed = true
>             calls?.navigationController?.pushViewController(details, animated: true)
>         })
>         return calls
>     }
> }
> ```

### 2. Add It as a Tab

> [tab] SwiftUI
>
> Use the `CallsTab` from step 1 where this shows the bare list:
>
> ```swift HomeView.swift theme={null}
> struct HomeView: View {
>     var body: some View {
>         TabView {
>             Tab("Chats", systemImage: "message") { MyScreen() }
>             Tab("Calls", systemImage: "phone") { CometChatCallLogs() }
>         }
>     }
> }
> ```

> [tab] UIKit
>
> Use `CallsCoordinator.makeCallLogs()` from step 1 where this shows the bare list:
>
> ```swift HomeViewController.swift theme={null}
> let calls = UINavigationController(rootViewController: CometChatCallLogs())
> calls.tabBarItem = UITabBarItem(title: "Calls", image: UIImage(systemName: "phone"), tag: 1)
> let home = UITabBarController()
> home.viewControllers = [calls]
> ```

The call log uses your navigation bar for its large "Calls" title in UIKit, and its own
`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:

| Tab | Content |
| - | - |
| Participants | each participant's avatar, name and time in the call — from the log |
| Recording | each recording, with **Play** (`AVPlayerViewController`) and **Download** (saved, then the share sheet) — from the log |
| History | every call with that user, or in that group, paged — fetched when the screen appears |

## Implementation Flow

1. `CometChatCallLogs` fetches the call log, 30 rows a page, and keeps it fresh: pull-to-refresh,
   a call ending, a reconnect.
2. The user taps a row → your handler pushes `CometChatCallLogDetails` with that `ChatCallLog`.
3. The details screen fetches the call's user or group for its header, and the History tab's
   first page.
4. The header's buttons, or a call log row's call-back button, place a new call.

## Customization Options

> [tab] SwiftUI
>
> ```swift theme={null}
> var style = CometChatCallLogDetailsStyle()
> style.tabIndicatorColor = .orange
> style.infoCardBackgroundColor = .orange.opacity(0.1)
>
> CometChatCallLogDetails(callLog: sampleCallLog, style: style,
>                         onPlayRecording: { recording in play(recording.url) })
> ```

> [tab] UIKit
>
> ```swift theme={null}
> CometChatCallLogDetails.style.tabIndicatorColor = .systemOrange
> CometChatCallLogDetails.style.infoCardBackgroundColor = .systemOrange.withAlphaComponent(0.1)
> ```

The tabs themselves are not public: you cannot add, remove or reorder them. Replace the header
with `headerView` in SwiftUI, or configure `messageHeader` in UIKit.

## Filtering & Edge Cases

* **Missed calls only:** pass `CallLogsQuery(direction: .missed)` — `callLogRequestBuilder` in
  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.

> [tab] SwiftUI
>
> ```swift theme={null}
> CometChatCallLogs(callLogRequestBuilder: CallLogsQuery(direction: .missed))
> ```

> [tab] UIKit
>
> ```swift theme={null}
> let missed = CometChatCallLogs()
>     .set(callRequestBuilder: CallLogsQuery(direction: .missed))
> ```

## Error Handling

> [tab] SwiftUI
>
> ```swift theme={null}
> CometChatCallLogDetails(callLog: sampleCallLog, onError: { error in report(error) })
> ```

> [tab] UIKit
>
> ```swift theme={null}
> let details = CometChatCallLogDetails(callLog: sampleCallLog)
>     .set(onError: { error in log(error) })
> ```

`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

| Feature | SwiftUI | UIKit |
| - | - | - |
| Display the call log | `CometChatCallLogs` | `CometChatCallLogs` |
| Open the details | `onItemClick` + `navigationDestination` | `set(goToCallLogDetail:)` |
| Details screen | `CometChatCallLogDetails(callLog:)` | `CometChatCallLogDetails(callLog:)` |
| Filter | `callLogRequestBuilder: CallLogsQuery` | `set(callRequestBuilder:)` |
| Theming | `CometChatCallLogDetailsStyle` | `CometChatCallLogDetails.style` |
| Errors and empty | `onError`, `onEmpty` | `set(onError:)`, `set(onEmpty:)` |

> [card] [Call Logs](https://www.cometchat.com/docs/ui-kit/ios/v6/call-logs.md)
>
> Every option of the call log

> [card] [Call Log Details](https://www.cometchat.com/docs/ui-kit/ios/v6/call-log-details.md)
>
> Every option of the details screen


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.