Enable Push Notifications on your Bundle ID
Log in to the Apple Developer portal and open your app’s Bundle ID. Ensure that Push Notifications is checked under the list of capabilities.
Enable Voice over IP capability in Xcode
Open your project in Xcode and go to:Xcode Project → Your Target → Signing & CapabilitiesClick + Capability and add Background Modes. Then check the Voice over IP option.
Create a VoIP Services Certificate
In the Apple Developer portal, go to Certificates, Identifiers & Profiles → Certificates → Add and select VoIP Services Certificate.After generating it, download the
.cer file and double-click it to install it into Keychain Access.Once installed, open Keychain Access, find the certificate, right-click it, and choose Export to save it as a .p12 file.Convert the certificate to .pem format
With your exported Keep
.p12 file, run the following command in your terminal to convert it to a .pem file that can be used for sending VoIP pushes:VOIP.pem somewhere safe — you will use it when sending test pushes.Configure VoIP push handling in AppDelegate.swift
Your
AppDelegate must implement PKPushRegistryDelegate to receive VoIP pushes and forward them to the plugin. The key delegate methods are:Retrieve the device push token in Dart
After the app launches and the Example output:Send this token to your server so it can target the device when initiating a VoIP call.
PKPushRegistry delegate fires, the token is stored by the plugin and can be retrieved from Dart:The token is only available after
SwiftFlutterCallkitIncomingPlugin.sharedInstance?.setDevicePushTokenVoIP(deviceToken) has been called inside pushRegistry(_:didUpdate:for:) in AppDelegate.swift.Test VoIP push delivery
You can test VoIP push delivery using the Replace
curl command or a dedicated Mac app.- curl
- PushNotifications app
com.hiennv.testing.voip with your app’s bundle ID suffixed with .voip, and replace <device token> with the token retrieved in the previous step.To test VoIP push delivery from a terminated app state, configure your Xcode scheme: Edit Scheme → Run → Launch → Wait for the executable to be launched. This prevents Xcode from automatically foregrounding the app, letting the push wake it instead.
