Skip to content

Cordova VoIP Calls

Pushwoosh supports VoIP-style call notifications for iOS and Android using the pushwoosh-cordova-plugin. This enables native VoIP call functionality, including incoming call UI and call control events.

Before you start, integrate the plugin with your Pushwoosh Application Code as described in the basic integration guide.

1. Add the Pushwoosh Cordova plugin with VoIP enabled

Anchor link to

Install the plugin with the VoIP flag enabled:

Terminal window
cordova plugin add pushwoosh-cordova-plugin --variable PW_VOIP_IOS_ENABLED=true --variable PW_VOIP_ANDROID_ENABLED=true

This will configure the plugin to support VoIP functionality on iOS.

2. Check the PushwooshVoIP dependency

Anchor link to

The plugin links the PushwooshVoIP module automatically. On cordova-ios 8, it adds the PushwooshVoIP Swift package and doesn’t change the Podfile. On earlier cordova-ios versions, it adds this line to your Podfile:

pod 'PushwooshXCFramework/PushwooshVoIP'

This module is required to support PushKit-based VoIP notifications and system-level call handling.

3. Enable VoIP background mode in Xcode

Anchor link to

Open your project in Xcode and follow these steps:

  1. Go to Signing & Capabilities.
  2. Add Background Modes capability.
  3. Check the Voice over IP option.

This allows your app to receive incoming VoIP pushes while in the background.

4. Request call permission on Android

Anchor link to

On Android, the app needs the user’s permission to receive calls. Request it with requestCallPermission(). If the user denies it, the app ignores incoming VoIP calls.

pushwoosh.requestCallPermission();

5. Set a custom ringtone (optional)

Anchor link to

The plugin initializes VoIP automatically. To play a custom ringtone for incoming calls, pass a sound file name from the app bundle:

pushwoosh.setRingtone("incoming.caf");

6. Available VoIP callbacks and methods

Anchor link to

Video support and the caller ID format are set per call in the VoIP push payload: video and, on iOS, handleType (1 for generic, 2 for phone number, 3 for email).

The Cordova plugin supports the following VoIP-related methods and events:

  • answer – called when a user answers an incoming call
  • endCall – called when a user ends the current call
  • hangup – called when a call is hung up
  • reject – called when an incoming call is rejected
  • muted – toggle mute status, iOS-only
  • held – toggle hold status, iOS-only
  • voipPushPayload – returns push payload for the incoming VoIP call
  • incomingCallSuccess – called when system call UI is successfully shown, iOS-only
  • incomingCallFailure – called when system call UI fails to show, iOS-only
  • speakerOn – turn speaker on
  • speakerOff – turn speaker off
  • playDTMF – play DTMF tone during a call, iOS-only
  • voipDidRegisterTokenSuccessfully – called when the VoIP token is registered with Pushwoosh, iOS-only
  • voipDidFailToRegisterTokenWithError – called when VoIP token registration fails, iOS-only
  • voipDidCancelCall – called when a call is cancelled remotely via a VoIP push
  • voipDidFailToCancelCall – called when a call cancellation attempt fails

These can be hooked using Cordova’s PushNotification object, allowing you to control and respond to VoIP call state changes.

On Android, you can also handle these events in your own native Java class, for example to open your own call screen when the user answers. See Custom call event handler on Android.

Anchor link to