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:- CometChat Chat SDK and Calls SDK integrated
- Push notifications configured for both platforms:
- Firebase Cloud Messaging (FCM) for Android
- APNs for iOS
- Push notifications enabled in CometChat Dashboard
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’sConnectionService to show the system call UI.
Step 1: Add FCM Dependencies
Add Firebase Messaging to your Androidbuild.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 yourAppDelegate 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
Related Documentation
- Ringing - Basic in-app call signaling
- Actions - Control call functionality
- Events - Listen for call state changes
- Background Handling - Keep active calls alive in background