CallKit
Build VoIP calling experiences that integrate with the native iOS call UI using CallKit and PushKit. Covers incoming and outgoing call flows, PushKit VoIP registration, audio session coordination, and call directory extensions. Targets Swift 6.3 / iOS 26+.
Contents
Capabilities and Key Types
Enable Voice over IP in Signing & Capabilities > Background Modes, and add the Push Notifications capability.
| Type |
Role |
CXProvider |
Reports incoming calls, connections, and external resets to the system; receives CXAction requests |
CXCallController |
Requests user-initiated call actions (CXStartCallAction, CXEndCallAction, CXSetHeldCallAction) |
CXCallUpdate |
Encapsulates call metadata (remote handle, caller name, video capability) |
CXProviderDelegate |
Handles telephony events, user interactions (answer, end, hold, mute), and audio session activation |
PKPushRegistry |
Registers for and receives PushKit VoIP push notifications |
Core Calling Architecture
[PushKit VoIP Push] ──> [reportNewIncomingCall] ──> [System Call UI]
│ (user answers)
▼
[WebRTC / VoIP Stack] <── [configureAudioSession] <── [CXAnswerCallAction]
- Maintain single CXProvider: Keep one retained
CXProvider instance alive across the app lifecycle. Recreating providers disconnects active calls.
- Handle CXProviderDelegate on serial queue: Dispatch delegate callbacks to a dedicated queue or
@MainActor to prevent race conditions during call state transitions.
- Fulfill or fail every action: Call
action.fulfill() or action.fail() promptly inside delegate methods. Unfulfilled actions cause UI timeouts.
Critical VoIP Push Rule
Every VoIP push received via pushRegistry(_:didReceiveIncomingPushWith:for:) must immediately report an incoming call to CallKit via reportNewIncomingCall(with:update:completion:).
[!WARNING]
Failing to report a new incoming call upon receiving a VoIP push causes iOS to terminate the app and revoke future VoIP push credentials. On iOS 26.4+, inspect PKVoIPPushMetadata to check if a push is exempt from reporting.
Audio Session Lifecycle
Do not activate the AVAudioSession during call initialization. Only configure categories in advance (.playAndRecord with .voiceChat mode). Activate the audio session only when the system invokes provider(_:didActivate:). Deactivate audio in provider(_:didDeactivate:).
Route by Task
- For a complete, observable VoIP call manager with incoming and outgoing flows, read Full Call Manager.
- For handling hold, mute, and multiple concurrent calls, read Hold and Mute Actions and Multiple Concurrent Calls.
- For encrypted VoIP push payloads and payload filtering, read Encrypted VoIP Push Filtering.
- For building Call Directory extensions (Caller ID and call blocking with incremental phone updates), read Call Directory Incremental Updates.
- For local debugging with terminal scripts and simulated push payloads, read Testing VoIP Locally.
Common Mistakes
- Receiving a VoIP push without calling
reportNewIncomingCall, causing iOS to terminate the app.
- Activating
AVAudioSession before the system calls provider(_:didActivate:).
- Forgetting to call
action.fulfill() in CXProviderDelegate action handlers.
- Recreating
CXProvider instances instead of keeping a single shared instance for the app lifecycle.
- Using standard APNs alerts for VoIP incoming calls instead of PushKit.
Review Checklist
References
1---2name: callkit3description: Implement VoIP calling with CallKit and PushKit. Use when building incoming/outgoing call flows, registering for VoIP push notifications, configuring CXProvider and CXCallController, handling call actions, coordinating audio sessions, or creating Call Directory extensions for caller ID and call blocking.4---56# CallKit78Build VoIP calling experiences that integrate with the native iOS call UI using CallKit and PushKit. Covers incoming and outgoing call flows, PushKit VoIP registration, audio session coordination, and call directory extensions. Targets Swift 6.3 / iOS 26+.910## Contents1112- [Capabilities and Key Types](#capabilities-and-key-types)13- [Core Calling Architecture](#core-calling-architecture)14- [Critical VoIP Push Rule](#critical-voip-push-rule)15- [Audio Session Lifecycle](#audio-session-lifecycle)16- [Route by Task](#route-by-task)17- [Common Mistakes](#common-mistakes)18- [Review Checklist](#review-checklist)19- [References](#references)2021## Capabilities and Key Types2223Enable **Voice over IP** in Signing & Capabilities > Background Modes, and add the **Push Notifications** capability.2425| Type | Role |26|---|---|27| `CXProvider` | Reports incoming calls, connections, and external resets to the system; receives `CXAction` requests |28| `CXCallController` | Requests user-initiated call actions (`CXStartCallAction`, `CXEndCallAction`, `CXSetHeldCallAction`) |29| `CXCallUpdate` | Encapsulates call metadata (remote handle, caller name, video capability) |30| `CXProviderDelegate` | Handles telephony events, user interactions (answer, end, hold, mute), and audio session activation |31| `PKPushRegistry` | Registers for and receives PushKit VoIP push notifications |3233## Core Calling Architecture3435```36[PushKit VoIP Push] ──> [reportNewIncomingCall] ──> [System Call UI]37 │ (user answers)38 ▼39[WebRTC / VoIP Stack] <── [configureAudioSession] <── [CXAnswerCallAction]40```41421. **Maintain single CXProvider**: Keep one retained `CXProvider` instance alive across the app lifecycle. Recreating providers disconnects active calls.432. **Handle CXProviderDelegate on serial queue**: Dispatch delegate callbacks to a dedicated queue or `@MainActor` to prevent race conditions during call state transitions.443. **Fulfill or fail every action**: Call `action.fulfill()` or `action.fail()` promptly inside delegate methods. Unfulfilled actions cause UI timeouts.4546## Critical VoIP Push Rule4748Every VoIP push received via `pushRegistry(_:didReceiveIncomingPushWith:for:)` **must** immediately report an incoming call to CallKit via `reportNewIncomingCall(with:update:completion:)`.4950> [!WARNING]51> Failing to report a new incoming call upon receiving a VoIP push causes iOS to terminate the app and revoke future VoIP push credentials. On iOS 26.4+, inspect `PKVoIPPushMetadata` to check if a push is exempt from reporting.5253## Audio Session Lifecycle5455Do not activate the `AVAudioSession` during call initialization. Only configure categories in advance (`.playAndRecord` with `.voiceChat` mode). Activate the audio session **only** when the system invokes `provider(_:didActivate:)`. Deactivate audio in `provider(_:didDeactivate:)`.5657## Route by Task5859- For a complete, observable VoIP call manager with incoming and outgoing flows, read [Full Call Manager](references/callkit-patterns.md#full-call-manager).60- For handling hold, mute, and multiple concurrent calls, read [Hold and Mute Actions](references/callkit-patterns.md#hold-and-mute-actions) and [Multiple Concurrent Calls](references/callkit-patterns.md#multiple-concurrent-calls).61- For encrypted VoIP push payloads and payload filtering, read [Encrypted VoIP Push Filtering](references/callkit-patterns.md#encrypted-voip-push-filtering).62- For building Call Directory extensions (Caller ID and call blocking with incremental phone updates), read [Call Directory Incremental Updates](references/callkit-patterns.md#call-directory-incremental-updates).63- For local debugging with terminal scripts and simulated push payloads, read [Testing VoIP Locally](references/callkit-patterns.md#testing-voip-locally).6465## Common Mistakes6667- Receiving a VoIP push without calling `reportNewIncomingCall`, causing iOS to terminate the app.68- Activating `AVAudioSession` before the system calls `provider(_:didActivate:)`.69- Forgetting to call `action.fulfill()` in `CXProviderDelegate` action handlers.70- Recreating `CXProvider` instances instead of keeping a single shared instance for the app lifecycle.71- Using standard APNs alerts for VoIP incoming calls instead of PushKit.7273## Review Checklist7475- [ ] Voice over IP background mode and Push Notifications capabilities enabled76- [ ] Single retained `CXProvider` shared across the application lifetime77- [ ] Every VoIP push immediately reports an incoming call via `reportNewIncomingCall`78- [ ] `AVAudioSession` activated exclusively inside `provider(_:didActivate:)`79- [ ] All `CXAction` delegate callbacks call `fulfill()` or `fail()` promptly80- [ ] App cleanly cleans up calls when `providerDidReset(_:)` is triggered81- [ ] Handle types (`.phoneNumber`, `.emailAddress`, `.generic`) match backend identifiers82- [ ] Outgoing calls reported with `reportOutgoingCall(with:startedConnectingAt:)` and `connectedAt:`83- [ ] Call Directory extension handles incremental reload without re-inserting unchanged numbers8485## References8687- [CallKit extended patterns and Call Directory guide](references/callkit-patterns.md)88- [CallKit documentation](https://sosumi.ai/documentation/callkit)89- [CXProvider](https://sosumi.ai/documentation/callkit/cxprovider)90- [CXCallController](https://sosumi.ai/documentation/callkit/cxcallcontroller)91- [PushKit documentation](https://sosumi.ai/documentation/pushkit)