Twilio Programmable Voice SDK for React Native allows you to add voice-over-IP (VoIP) calling into your React Native apps. Please check out the following if you are new to Twilio's Programmable Voice or React Native.
For step-by-step instructions to get up and running with the React Native SDK for Programmable Voice, check out the reference app on github.
Under the hood, the Voice React Native SDK utilizes the Android and iOS Twilio Programmable Voice SDKs. Check out the following pages for more details on each platform.
The package is available through npm.
yarn add @twilio/voice-react-native-sdk
Using this method, you can import the Voice SDK using ES Module or TypeScript syntax.
1import { Voice } from '@twilio/voice-react-native-sdk';23// getAccessToken should fetch an AccessToken from your backend4const token = getAccessToken();5const voice = new Voice();67// Allow incoming calls8await voice.register(token);910// Handle incoming calls11voice.on('callInvite', (callInvite) => {12callInvite.accept();13});1415// Make an outgoing call16const call = await voice.connect(token, params);
The Twilio Voice React Native SDK is open source. Check out our repository if you want to install from Github or build it locally.
Developer tools and configuration options for Programmable Voice can be found in the Programmable Voice Dashboard. Use the console to create TwiML apps, update push credentials, view logs, and much more.