Skip to content

@capgo/capacitor-twilio-voice

Integrate Twilio Voice API for high-quality VoIP calling with call management, audio controls, and real-time communication.

The Capacitor Twilio Voice plugin enables high-quality VoIP calling functionality in iOS and Android applications using Twilio’s Voice API. This plugin provides comprehensive call management, authentication, and audio controls for creating professional calling experiences.

VoIP calling

High-quality voice calls over internet using Twilio Voice API 📞

Call management

Make, accept, reject, and end calls with full lifecycle control 🎛️

Audio controls

Mute, speaker toggle, and audio routing options 🎤

Platform support

Native iOS and Android implementation with push notifications 📱

Terminal window
npm install @capgo/capacitor-twilio-voice
npx cap sync
  • login(options: { accessToken: string }) - Authenticate with Twilio using access token
  • logout() - End user session and clear call state
  • isLoggedIn() - Check current authentication status
  • makeCall(options: { to: string }) - Initiate outgoing call to specified number
  • acceptCall(options: { callSid: string }) - Accept incoming call
  • rejectCall(options: { callSid: string }) - Reject incoming call
  • endCall(options?: { callSid?: string }) - Terminate active call
  • muteCall(options: { muted: boolean, callSid?: string }) - Mute/unmute call audio
  • setSpeaker(options: { enabled: boolean }) - Toggle speaker output

The plugin provides comprehensive event handling for:

  • Registration events for connection status
  • Call state changes (connected, disconnected, ringing)
  • Quality warnings and connection issues
  • Incoming call notifications
  • Requires PushKit integration for incoming calls
  • Certificate configuration for production use
  • Microphone permissions in Info.plist
  • Firebase setup for push notifications
  • Microphone permissions in AndroidManifest.xml
  • Background service configuration
import { TwilioVoice } from '@capgo/capacitor-twilio-voice';
// Authenticate with Twilio
await TwilioVoice.login({ accessToken: 'your-twilio-access-token' });
// Make a call
await TwilioVoice.makeCall({ to: '+1234567890' });
// Listen for call events
TwilioVoice.addListener('callConnected', (data) => {
console.log('Call connected:', data);
});

Check the complete documentation for detailed setup instructions, advanced configuration, and integration examples.