Skip to main content
Implement native VoIP calling that works when your app is in the background or killed. This guide shows how to integrate Apple’s CallKit framework with CometChat to display system call UI, handle calls from the lock screen, and provide a native calling experience.

Overview

VoIP calling differs from basic in-app ringing by leveraging Apple’s CallKit to:
  • Show incoming calls on lock screen with system UI
  • Handle calls when app is in background or killed
  • Integrate with CarPlay, Bluetooth, and other audio accessories
  • Provide consistent call experience across iOS devices

Prerequisites

Before implementing VoIP calling, ensure you have:
This documentation builds on the Ringing functionality. Make sure you understand basic call signaling before implementing VoIP.

Architecture Overview

The VoIP implementation consists of several components working together:

Step 1: Configure Push Notifications

VoIP push notifications are essential for receiving incoming calls when your app is not in the foreground.

1.1 Enable VoIP Capability

In Xcode, add the following capabilities to your app:
  1. Go to your target’s “Signing & Capabilities” tab
  2. Add “Push Notifications” capability
  3. Add “Background Modes” capability and enable:
    • Voice over IP
    • Background fetch
    • Remote notifications

1.2 Register for VoIP Push

1.3 Handle VoIP Push Registration


Step 2: Create CallManager

The CallManager coordinates between CometChat and CallKit:

Step 3: Implement CXProviderDelegate

Handle CallKit callbacks for user actions:

Step 4: Handle Call End Events

Update CallKit when the call ends from the remote side: