Twilio's Voice React Native SDK allows you to add real-time voice and PSTN calling to your React Native apps.
Please check out the following if you are new to Twilio's Programmable Voice or React Native.
The package is available through npm.
yarn add @twilio/voice-react-native-sdkOnce the package has been installed to your React Native application, there are further steps that you will need to take for both iOS and Android platforms. Please see the supporting documentation below.
This is a forked version of the Twilio Voice React Native SDK. If you need to build and publish new versions of this package to npm, follow these steps:
- Node.js and Yarn: Ensure you have Node.js and Yarn installed
- NPM Account: You need to be logged into npm with the appropriate permissions
- Git Repository: Make sure your changes are committed to your fork
-
Install Dependencies:
yarn install
-
Build the Package:
yarn prepare
This command will:
- Generate constants from source files
- Build CommonJS, ES modules, and TypeScript definitions
- Create source maps for debugging
- Output files to the
lib/directory
-
Verify Build Output: Check that the following directories are created:
lib/commonjs/- CommonJS moduleslib/module/- ES moduleslib/typescript/- TypeScript definitions
-
Update Version: Edit
package.jsonand increment the version number:{ "version": "1.6.2-fork.2" // Increment from previous version } -
Verify Package Configuration: Ensure your
package.jsonhas the correct:- Package name (e.g.,
@your-username/voice-react-native-sdk) - Repository URLs pointing to your fork
- Author information
- Package name (e.g.,
-
Login to NPM:
npm login
-
Publish the Package:
npm publish --access public
Once published, you can install your forked version in any React Native project:
# Install your forked version
npm install @your-username/voice-react-native-sdk
# or
yarn add @your-username/voice-react-native-sdkThen import and use it exactly like the original Twilio SDK:
import { Voice } from '@your-username/voice-react-native-sdk';
const voice = new Voice();
// Use the SDK as normalThe published package includes:
- Source Code: Original TypeScript/JavaScript source files
- Built Libraries: Compiled CommonJS and ES modules
- Type Definitions: Complete TypeScript definitions
- Native Code: Android (Java) and iOS (Objective-C) implementations
- Assets: Audio files, icons, and other resources
- Source Maps: For debugging compiled code
- Build Errors: Run
yarn installto ensure all dependencies are installed - Publish Errors: Verify you're logged into npm with
npm whoami - Permission Errors: Ensure you have publish rights to the npm scope/organization
- Version Conflicts: Make sure the version number is unique and higher than the previous version
Learn how to get started for the iOS platform.
Learn how to get started for the Android platform if you are using Java or Kotlin.
If you are migrating from a version of the Twilio Voice React Native SDK < 1.0.0.beta.4 to a version >= 1.0.0.beta.4, please see this document.
To customize the appearance and content of your application's notifications, please see this document.
To enable your application to play a ringback tone while making an outgoing call, please see this document.
To have your application implement or use its own PushKit delegate module, please see this document.
To have your application implement or use a different FirebaseMessagingService (such as OneSignal or RNFirebase), please see this document.
Please check out our common issues page or file any issues you find here on Github. For general inquiries related to the Voice SDK you can file a support ticket.
Please ensure that you are not sharing any Personally Identifiable Information(PII) or sensitive account information (API keys, credentials, etc.) when reporting an issue.
Please check out our known issues for known bugs and workarounds.
See LICENSE