voice-react-native-sdk
v1.6.2-fork.44
Published
Twilio Voice React Native SDK
Downloads
850
Readme
Twilio Voice React Native SDK
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.
Installation
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.
Building and Publishing New Versions
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:
Prerequisites
- 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
Build Process
Install Dependencies:
yarn installBuild the Package:
yarn prepareThis 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
Publishing to NPM
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 loginPublish the Package:
npm publish --access public
Using Your Published Package
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 normalPackage Structure
The 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
Troubleshooting
- 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
Supporting Documentation
Getting Started
iOS
Learn how to get started for the iOS platform.
Android
Learn how to get started for the Android platform if you are using Java or Kotlin.
Migration Guide
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.
Customizing Notifications
To customize the appearance and content of your application's notifications, please see this document.
Outgoing Call Ringback Tone
To enable your application to play a ringback tone while making an outgoing call, please see this document.
Out-of-band PushKit Handling
To have your application implement or use its own PushKit delegate module, please see this document.
Out-of-band Firebase Messaging Service
To have your application implement or use a different FirebaseMessagingService (such as OneSignal or RNFirebase), please see this document.
Issues and Support
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.
Related
License
See LICENSE
