🔔 VoIP Push Notification Setup (iOS)
⚠️ Important Notes:
- Real Device Only: iOS VoIP Push only works on physical devices. It does not work on the iOS Simulator.
- Annual VoIP Certificate Renewal (1-Year Expiry): Apple VoIP Services Certificates (
.p12) expire every 1 year. You must generate a renewed certificate on the Apple Developer Portal and re-upload the updated.p12file to the Portal periodically each year to maintain uninterrupted VoIP push notification delivery.
🌟 Overview
When a user receives a call, VoIP Server sends a push notification to your app. The app then wakes up via CallKit to display the native incoming call UI.

Native Call Experience
| iOS (Alert) | iOS (Lock Screen) | iOS (Full Screen) |
|---|---|---|
🛠 Step-by-Step Guide
📌 Step 1: Apple Developer Configuration
You need to generate two items: a VoIP Services Certificate (for CallKit) and an APNs Key (for Firebase).
1.1 Create VoIP Services Certificate
- Go to Apple Developer Certificates.
- Click (+) to create a new certificate.
- Select VoIP Services Certificate under Services.

- Choose your App ID and click Continue.

- Upload your Certificate Signing Request (CSR) and Download the
.cerfile.
- Follow the instructions to create a certificate signing request.
- Double-click the
.cerfile to install it into Keychain Access. - Right-click the certificate in Keychain Access and export it as a .p12 file. (Keep this file for Step 4).

1.2 Create APNs Key (For Firebase)
- Go to Keys in the Apple Developer sidebar.
- Create a new key and enable Apple Push Notifications service (APNs).

- Download the
.p8file. (Keep this file for Step 3).
📌 Step 2: Xcode & iOS Project Configuration
2.1 Enable Capabilities
Open your project in Xcode → Signing & Capabilities:
-
Add Push Notifications.
-
Add Background Modes and check all of the following:
- ✅ Voice over IP (
voip) - ✅ Audio, AirPlay, and Picture in Picture (
audio) - ✅ Background fetch (
fetch) - ✅ Remote notifications (
remote-notification)

(Optional) Or configure directly in
Info.plist:<key>UIBackgroundModes</key>
<array>
<string>audio</string>
<string>fetch</string>
<string>processing</string>
<string>remote-notification</string>
<string>voip</string>
</array> - ✅ Voice over IP (
2.2 Add Firebase Configuration
-
Download
GoogleService-Info.plistfrom your Firebase Console. -
Drag and drop it into your Xcode project root (under the main app target folder).
-
Important: Ensure "Copy items if needed" is checked.

2.3 Configure CocoaPods for static linking
RNFirebase autolinks Firebase. Do not add the Firebase umbrella pod or
FirebaseMessaging manually. When the app uses static CocoaPods libraries, add
the following module-map overrides inside the application target:
target 'YourApp' do
config = use_native_modules!
pod 'FirebaseCore', :modular_headers => true
pod 'FirebaseCoreInternal', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
# use_react_native!(...)
end
Skip these individual overrides if the Podfile already calls
use_modular_headers! globally.
2.4 Integrate with AppDelegate
Merge the initialization below into your existing AppDelegate. Keep its React Native startup code and sourceURL(for:) / bundleURL() overrides, as shown in the example AppDelegate.
Option A: Swift (AppDelegate.swift - RN 0.74+)
import UIKit
import React
import React_RCTAppDelegate
import FirebaseCore
import react_native_pitel_voip_v2
@main
class AppDelegate: RCTAppDelegate {
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
self.moduleName = "YourAppName"
self.initialProps = [:]
FirebaseApp.configure()
// Initialize PushKit listener before bridge starts
_ = PitelVoIPDelegate()
PitelVoIP.configure()
let result = super.application(application, didFinishLaunchingWithOptions: launchOptions)
PitelVoIP.registerCallPresentationHostProvider { [weak self] in
self?.window.rootViewController
}
return result
}
}
Keep RNFirebase method swizzling enabled. Do not manually override APNs token or remote-notification callbacks in
AppDelegate; RNFirebase must be the only owner of those callbacks.
Option B: Objective-C (AppDelegate.mm)
-
Import the Swift bridging header of the VoIP module & Firebase:
#import <FirebaseCore/FirebaseCore.h>
#import <react_native_pitel_voip_v2/react_native_pitel_voip_v2-Swift.h> -
Initialize
PitelVoIPDelegate, configure SDK bootstrap, and register call presentation host:- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.moduleName = @"YourAppName";
self.initialProps = @{};
// 1. Configure Firebase Core
[FIRApp configure];
// 2. Initialize PitelVoIPDelegate before JS bridge starts
(void)[[PitelVoIPDelegate alloc] init];
[PitelVoIPBootstrap configure];
BOOL result = [super application:application didFinishLaunchingWithOptions:launchOptions];
// 3. Register presentation host for native Call Screen
[PitelVoIPBootstrap registerCallPresentationHostProvider:^UIViewController * _Nullable{
return self.window.rootViewController;
}];
return result;
}
2.5 Configure Info.plist
Add required usage descriptions and background modes in ios/<YourAppName>/Info.plist inside <dict>:
<!-- Microphone Permission (Mandatory) -->
<key>NSMicrophoneUsageDescription</key>
<string>Need microphone access for VoIP calls.</string>
<!-- Bluetooth Permission (Optional - for Bluetooth headsets) -->
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Need Bluetooth access for VoIP calls.</string>
<!-- Local Network Permission (for Metro Bundler Debugging & SIP Discovery) -->
<key>NSLocalNetworkUsageDescription</key>
<string>Need local network access to discover and connect to SIP server.</string>
<!-- Background Modes (can also be configured via Xcode Capabilities) -->
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
<string>voip</string>
<string>fetch</string>
<string>remote-notification</string>
</array>
📌 Step 3: Firebase & Server Configuration
3.1 Upload APNs Key to Firebase
- Go to Firebase Console → Project Settings → Cloud Messaging.
- Under Apple app configuration, locate your iOS app.

- Upload the
.p8APNs Key (from Step 1.2). - Enter your Key ID and Team ID.

3.2 Generate Service Account
VoIP Server uses this to send push notifications on your behalf.
- In Firebase Console, go to Project Settings → Service Accounts.
- Click Generate new private key.

- A
.jsonfile will be downloaded. (Keep this file for Step 4).
3.3 Obtain & Forward FCM Token in React Native
React Native Firebase automatically registers with APNs. Request notification permission, then retrieve and forward the FCM token:
import { Platform } from 'react-native';
import { getMessaging, getToken, onTokenRefresh, requestPermission } from '@react-native-firebase/messaging';
import { PitelVoipClient } from 'react-native-pitel-voip-v2';
const messaging = getMessaging();
if (Platform.OS === 'ios') {
await requestPermission(messaging);
}
const fcmToken = await getToken(messaging);
if (fcmToken) {
await PitelVoipClient.instance.setFCMToken(fcmToken);
}
onTokenRefresh(messaging, async token => {
await PitelVoipClient.instance.setFCMToken(token);
});
Register the background handler once in the application entry file, before
AppRegistry.registerComponent:
import { getMessaging, setBackgroundMessageHandler } from '@react-native-firebase/messaging';
import { PitelVoipClient } from 'react-native-pitel-voip-v2';
setBackgroundMessageHandler(getMessaging(), async message => {
if (message.data) {
await PitelVoipClient.instance.handlePushNotification(message.data);
}
});
Use onMessage for the same forwarding while the app is in the foreground.
Do not also forward FCM payloads from AppDelegate.
🚀 Step 4: Update VoIP Portal
Finally, upload the necessary credentials to the Portal to activate VoIP services.
- Upload
.p12File: The VoIP Certificate from Step 1.1. - Upload
.jsonFile: The Service Account file from Step 3.2.
Annual Renewal Requirement: Apple VoIP Certificates expire every 1 year. Remember to set an annual reminder to renew your certificate and re-upload the updated .p12 to the Portal.
Note: Ensure you have configured your app on the portal as described in the Portal Guide.
✅ Testing
Run the app on a Real Device (iPhone) to test receiving calls in the background and locked state.
