Gathering detailed insights and metrics for @nois/react-native-twilio-programmable-voice
Gathering detailed insights and metrics for @nois/react-native-twilio-programmable-voice
Gathering detailed insights and metrics for @nois/react-native-twilio-programmable-voice
Gathering detailed insights and metrics for @nois/react-native-twilio-programmable-voice
React Native wrapper for Twilio Programmable Voice SDK
npm install @nois/react-native-twilio-programmable-voice
Typescript
Module System
Node Version
NPM Version
Java (68.86%)
Objective-C (27.58%)
JavaScript (2.83%)
Ruby (0.73%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
185 Stars
189 Commits
151 Forks
16 Watchers
6 Branches
17 Contributors
Updated on May 24, 2025
Latest Version
3.22.3
Package Id
@nois/react-native-twilio-programmable-voice@3.22.3
Unpacked Size
197.26 kB
Size
82.11 kB
File Count
34
NPM Version
6.0.1
Node Version
8.11.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
This is a React Native wrapper for Twilio Programmable Voice SDK that lets you make and receive calls from your ReactNatvie App. This module is not curated nor maintained, but inspired by Twilio.
initialized
instead of initilized
connectionDidConnect
returns the same properties as Android
move property to
=> call_to
move property from
=> call_from
You will need to make changes both on your Twilio account using Twilio Web Console and on your react native app.
Twilio Programmable Voice Android SDK uses FCM
since version 2.0.0.beta5.
Before you start, I strongly suggest that you read the list of Twilio changes from Android SDK v2.0.0 beta4 to beta5: Twilio example App: Migrating from GCM to FCM
These are all the changes required:
AndroidManifest.xml
and add the following code to receive FCM
notifications
(I wasn't successful in keeping react-native-fcm working at the same time. If you know how please open an issue to share).1 ..... 2 3 <!-- Twilio Voice --> 4 <!-- [START fcm_listener] --> 5 <service 6 android:name="com.hoxfon.react.TwilioVoice.fcm.VoiceFirebaseMessagingService"> 7 <intent-filter> 8 <action android:name="com.google.firebase.MESSAGING_EVENT" /> 9 </intent-filter> 10 </service> 11 <!-- [END fcm_listener] --> 12 <!-- [START instanceId_listener] --> 13 <service 14 android:name="com.hoxfon.react.TwilioVoice.fcm.VoiceFirebaseInstanceIDService" 15 android:exported="false"> 16 <intent-filter> 17 <action android:name="com.google.android.gms.iid.InstanceID" /> 18 </intent-filter> 19 </service> 20 <!-- [END instanceId_listener] --> 21 <!-- Twilio Voice -->
Server key
FCM
, fcm secret Firebase FCM Server key
google-services.json
; if you have not include it yetIf something doesn't work as expected or you want to make a request open an issue.
There is no need to ask permissions to contribute. Just open an issue or provide a PR. Everybody is welcome to contribute.
ReactNative success is directly linked to its module ecosystem. One way to make an impact is helping contributing to this module or another of the many community lead ones.
Before starting, we recommend you get familiar with Twilio Programmable Voice SDK. It's easier to integrate this module into your react-native app if you follow the Quick start tutorial from Twilio, because it makes very clear which setup steps are required.
npm install react-native-twilio-programmable-voice --save
react-native link react-native-twilio-programmable-voice
After you have linked the library with react-native link react-native-twilio-programmable-voice
check that libRNTwilioVoice.a
is present under YOUR_TARGET > Build Phases > Link Binaries With Libraries. If it is not present you can add it using the + sign at the bottom of that list.
Edit your Podfile
to include TwilioVoice framework
source 'https://github.com/cocoapods/specs'
# min version for TwilioVoice to work
platform :ios, '8.1'
target <YOUR_TARGET> do
...
pod 'TwilioVoice', '~> 2.0.0'
...
end
run pod install
from inside your project ios
directory
Edit your Podfile
to include TwilioVoice and RNTwilioVoice frameworks
source 'https://github.com/cocoapods/specs'
# min version for TwilioVoice to work
platform :ios, '8.1'
target <YOUR_TARGET> do
...
pod 'TwilioVoice', '~> 2.0.0'
pod 'RNTwilioVoice', path: '../node_modules/react-native-twilio-programmable-voice'
...
end
run pod install
from inside your project ios
directory
The current iOS part of this library works through CallKit. Because of this the call flow is much simpler than on Android as CallKit handles the inbound calls answering, ignoring, or rejecting. Because of CallKit, the only event listeners present are "deviceReady", "connectionDidConnect", "connectionDidDisconnect", and "callRejected".
Twilio Programmable Voice for iOS utilizes Apple's VoIP Services and VoIP "Push Notifications" instead of FCM. You will need a VoIP Service Certificate from Apple to receive calls.
Setup FCM
You must download the file google-services.json
from the Firebase console.
It contains keys and settings for all your applications under Firebase. This library obtains the resource senderID
for registering for remote GCM from that file.
NOTE: To use a specific play-service-gcm
version, update the compile
instruction in your App's android/app/build.gradle
(replace 10.+
with the version you prefer):
1... 2 3buildscript { 4 ... 5 dependencies { 6 classpath 'com.google.gms:google-services:3.1.2' 7 } 8} 9 10... 11 12dependencies { 13 ... 14 15 compile project(':react-native-twilio-programmable-voice') 16} 17 18// this plugin looks for google-services.json in your project 19apply plugin: 'com.google.gms.google-services'
In your AndroidManifest.xml
1 ..... 2 <uses-permission android:name="android.permission.VIBRATE" /> 3 4 5 <application ....> 6 7 .... 8 9 <!-- Twilio Voice --> 10 <!-- [START fcm_listener] --> 11 <service 12 android:name="com.hoxfon.react.RNTwilioVoice.fcm.VoiceFirebaseMessagingService"> 13 <intent-filter> 14 <action android:name="com.google.firebase.MESSAGING_EVENT" /> 15 </intent-filter> 16 </service> 17 <!-- [END fcm_listener] --> 18 <!-- [START instanceId_listener] --> 19 <service 20 android:name="com.hoxfon.react.RNTwilioVoice.fcm.VoiceFirebaseInstanceIDService" 21 android:exported="false"> 22 <intent-filter> 23 <action android:name="com.google.android.gms.iid.InstanceID" /> 24 </intent-filter> 25 </service> 26 <!-- [END instanceId_listener] --> 27 <!-- Twilio Voice --> 28 29 ..... 30
In android/settings.gradle
1... 2 3include ':react-native-twilio-programmable-voice' 4project(':react-native-twilio-programmable-voice').projectDir = file('../node_modules/react-native-twilio-programmable-voice/android')
Register module (in MainApplication.java
)
1import com.hoxfon.react.RNTwilioVoice.TwilioVoicePackage; // <--- Import Package 2 3public class MainApplication extends Application implements ReactApplication { 4 5 private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 6 @Override 7 protected boolean getUseDeveloperSupport() { 8 return BuildConfig.DEBUG; 9 } 10 11 @Override 12 protected List<ReactPackage> getPackages() { 13 return Arrays.<ReactPackage>asList( 14 new MainReactPackage(), 15 new TwilioVoicePackage() // <---- Add the Package : by default it will ask microphone permissions 16 // new TwilioVoicePackage(false) // <---- pass false to handle microphone permissions in your application 17 ); 18 } 19 }; 20 .... 21}
1import TwilioVoice from 'react-native-twilio-programmable-voice' 2 3// ... 4 5// initialize the Programmable Voice SDK passing an access token obtained from the server. 6// Listen to deviceReady and deviceNotReady events to see whether the initialization succeeded. 7async function initTelephony() { 8 try { 9 const accessToken = await getAccessTokenFromServer() 10 const success = await TwilioVoice.initWithToken(accessToken) 11 } catch (err) { 12 console.err(err) 13 } 14} 15 // iOS Only 16function initTelephonyWithUrl(url) { 17 TwilioVoice.initWithTokenUrl(url) 18 try { 19 TwilioVoice.configureCallKit({ 20 appName: 'TwilioVoiceExample', // Required param 21 imageName: 'my_image_name_in_bundle', // OPTIONAL 22 ringtoneSound: 'my_ringtone_sound_filename_in_bundle' // OPTIONAL 23 }) 24 } catch (err) { 25 console.err(err) 26 } 27}
1// add listeners (flowtype notation) 2TwilioVoice.addEventListener('deviceReady', function() { 3 // no data 4}) 5TwilioVoice.addEventListener('deviceNotReady', function(data) { 6 // { 7 // err: string 8 // } 9}) 10TwilioVoice.addEventListener('connectionDidConnect', function(data) { 11 // Android 12 // { 13 // call_sid: string, // Twilio call sid 14 // call_state: 'PENDING' | 'CONNECTED' | 'ACCEPTED' | 'CONNECTING' 'DISCONNECTED' | 'CANCELLED', 15 // call_from: string, // "+441234567890" 16 // call_to: string, // "client:bob" 17 // } 18 // iOS 19 // { 20 // call_sid: string, // Twilio call sid 21 // call_state: 'PENDING' | 'CONNECTED' | 'ACCEPTED' | 'CONNECTING' 'DISCONNECTED' | 'CANCELLED', 22 // from: string, // "+441234567890" // issue 44 (https://github.com/hoxfon/react-native-twilio-programmable-voice/issues/44) 23 // to: string, // "client:bob" // issue 44 (https://github.com/hoxfon/react-native-twilio-programmable-voice/issues/44) 24 // } 25}) 26TwilioVoice.addEventListener('connectionDidDisconnect', function(data: mixed) { 27 // | null 28 // | { 29 // err: string 30 // } 31 // | Android 32 // { 33 // call_sid: string, // Twilio call sid 34 // call_state: 'PENDING' | 'CONNECTED' | 'ACCEPTED' | 'CONNECTING' 'DISCONNECTED' | 'CANCELLED', 35 // call_from: string, // "+441234567890" 36 // call_to: string, // "client:bob" 37 // err?: string, 38 // } 39 // | iOS 40 // { 41 // call_sid: string, // Twilio call sid 42 // call_state: 'PENDING' | 'CONNECTED' | 'ACCEPTED' | 'CONNECTING' 'DISCONNECTED' | 'CANCELLED', 43 // call_from?: string, // "+441234567890" 44 // call_to?: string, // "client:bob" 45 // from?: string, // "+441234567890" // issue 44 (https://github.com/hoxfon/react-native-twilio-programmable-voice/issues/44) 46 // to?: string, // "client:bob" // issue 44 (https://github.com/hoxfon/react-native-twilio-programmable-voice/issues/44) 47 // error?: string, // issue 44 (https://github.com/hoxfon/react-native-twilio-programmable-voice/issues/44) 48 // } 49}) 50 51// iOS Only 52TwilioVoice.addEventListener('callRejected', function(value: 'callRejected') {}) 53 54// Android Only 55TwilioVoice.addEventListener('deviceDidReceiveIncoming', function(data) { 56 // { 57 // call_sid: string, // Twilio call sid 58 // call_state: 'PENDING' | 'CONNECTED' | 'ACCEPTED' | 'CONNECTING' 'DISCONNECTED' | 'CANCELLED', 59 // call_from: string, // "+441234567890" 60 // call_to: string, // "client:bob" 61 // } 62}) 63// Android Only 64TwilioVoice.addEventListener('proximity', function(data) { 65 // { 66 // isNear: boolean 67 // } 68}) 69// Android Only 70TwilioVoice.addEventListener('wiredHeadset', function(data) { 71 // { 72 // isPlugged: boolean, 73 // hasMic: boolean, 74 // deviceName: string 75 // } 76}) 77 78// ... 79 80// start a call 81TwilioVoice.connect({To: '+61234567890'}) 82 83// hangup 84TwilioVoice.disconnect() 85 86// accept an incoming call (Android only, in iOS CallKit provides the UI for this) 87TwilioVoice.accept() 88 89// reject an incoming call (Android only, in iOS CallKit provides the UI for this) 90TwilioVoice.reject() 91 92// ignore an incoming call (Android only) 93TwilioVoice.ignore() 94 95// mute or un-mute the call 96// mutedValue must be a boolean 97TwilioVoice.setMuted(mutedValue) 98 99TwilioVoice.sendDigits(digits) 100 101// should be called after the app is initialized 102// to catch incoming call when the app was in the background 103TwilioVoice.getActiveCall() 104 .then(incomingCall => { 105 if (incomingCall){ 106 _deviceDidReceiveIncoming(incomingCall) 107 } 108 })
react-native-push-notification
MIT
No vulnerabilities found.
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
binaries present in source code
Details
Reason
Found 7/19 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More