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 platform-specific push notification services with CometChat to display system call UI and provide a native calling experience.

Overview

VoIP calling differs from basic in-app ringing by leveraging platform-native call frameworks to:
  • Show incoming calls on lock screen with system UI
  • Handle calls when app is in background or killed
  • Integrate with Bluetooth, car systems, and wearables
  • Provide consistent call experience across devices

Prerequisites

Before implementing VoIP calling, ensure you have:
VoIP calling in Flutter requires native platform code alongside your Dart code. The push notification handling and system call UI integration must be implemented natively on each platform, then bridged to Flutter via method channels or platform-specific plugins.
This documentation builds on the Ringing functionality. Make sure you understand basic call signaling before implementing VoIP.

Architecture Overview

The VoIP implementation consists of platform-specific components working together with your Flutter app:

Android: FCM Integration

On Android, incoming calls are delivered via Firebase Cloud Messaging (FCM). When a call notification arrives while the app is in the background, you use Android’s ConnectionService to show the system call UI.

Step 1: Add FCM Dependencies

Add Firebase Messaging to your Android build.gradle:

Step 2: Create FirebaseMessagingService

In your Android native code (android/app/src/main/), create a service to handle incoming call push notifications:

Step 3: Register in AndroidManifest

For the full Android ConnectionService implementation including PhoneAccount registration, CallConnection, and CallNotificationManager, refer to the Android VoIP Calling documentation. The native Android code is identical whether used in a native Android app or a Flutter app’s Android module.

iOS: APNs + CallKit Integration

On iOS, incoming VoIP calls are delivered via Apple Push Notification service (APNs) with VoIP push certificates. CallKit provides the native iOS call UI.

Step 1: Enable Capabilities

In Xcode, enable the following capabilities for your iOS target:
  • Push Notifications
  • Background Modes → Voice over IP, Remote notifications

Step 2: Configure PushKit and CallKit

In your iOS native code (ios/Runner/), set up PushKit to receive VoIP pushes and CallKit to display the call UI:

Step 3: Bridge to Flutter

Set up a method channel in your AppDelegate to communicate between native iOS code and Flutter:

Flutter: Handle Call Events

On the Dart side, set up a method channel to receive call events from native code and manage the call lifecycle:

Register FCM Token

Register the FCM token with CometChat to receive push notifications on Android:

Initiate Outgoing Calls

To make an outgoing VoIP call, use the CometChat Chat SDK to initiate the call, then join the session:

Complete Flow Diagram

This diagram shows the complete flow for both incoming and outgoing VoIP calls:

Troubleshooting