{"id":4751,"url":"https://github.com/hoxfon/react-native-twilio-programmable-voice","last_synced_at":"2025-08-04T02:31:36.241Z","repository":{"id":37743005,"uuid":"72005051","full_name":"hoxfon/react-native-twilio-programmable-voice","owner":"hoxfon","description":"React Native wrapper for Twilio Programmable Voice SDK","archived":false,"fork":false,"pushed_at":"2023-08-14T09:05:41.000Z","size":38318,"stargazers_count":185,"open_issues_count":41,"forks_count":151,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-07-09T11:08:01.230Z","etag":null,"topics":["react-native","twilio","twilio-voice"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hoxfon.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-10-26T13:19:40.000Z","updated_at":"2025-05-24T20:04:35.000Z","dependencies_parsed_at":"2024-03-04T15:06:38.105Z","dependency_job_id":null,"html_url":"https://github.com/hoxfon/react-native-twilio-programmable-voice","commit_stats":{"total_commits":174,"total_committers":21,"mean_commits":8.285714285714286,"dds":0.1724137931034483,"last_synced_commit":"ff6b897676ce7ed99c75b177ec4e3bca19d88875"},"previous_names":[],"tags_count":48,"template":false,"template_full_name":null,"purl":"pkg:github/hoxfon/react-native-twilio-programmable-voice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoxfon%2Freact-native-twilio-programmable-voice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoxfon%2Freact-native-twilio-programmable-voice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoxfon%2Freact-native-twilio-programmable-voice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoxfon%2Freact-native-twilio-programmable-voice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hoxfon","download_url":"https://codeload.github.com/hoxfon/react-native-twilio-programmable-voice/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoxfon%2Freact-native-twilio-programmable-voice/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268639931,"owners_count":24282678,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["react-native","twilio","twilio-voice"],"created_at":"2024-01-05T20:17:22.191Z","updated_at":"2025-08-04T02:31:35.941Z","avatar_url":"https://github.com/hoxfon.png","language":"Java","funding_links":[],"categories":["Components"],"sub_categories":["Integrations"],"readme":"# react-native-twilio-programmable-voice\n\nThis is a react-native wrapper around [Twilio Programmable Voice SDK](https://www.twilio.com/voice), which allows your react-native app to make and receive calls.\n\nThis module is not affiliated with nor officially maintained by Twilio. It is maintained by open source contributors working during their nights and weekends.\n\nTested with:\n\n- react-native 0.62.2\n- Android 11\n- iOS 14\n\n## Roadmap\n\n### Project 1\n\nThe most updated branch is [feat/twilio-android-sdk-5](https://github.com/hoxfon/react-native-twilio-programmable-voice/tree/feat/twilio-android-sdk-5) which is aligned with:\n\n- Android 5.0.2\n- iOS 5.2.0\n\nIt contains breaking changes from `react-native-twilio-programmable-voice` v4, and it will be released as v5.\n\nYou can install it with:\n```bash\n# Yarn\nyarn add https://github.com/hoxfon/react-native-twilio-programmable-voice#feat/twilio-android-sdk-5\n\n# NPM\nnpm install git+https://github.com/hoxfon/react-native-twilio-programmable-voice#feat/twilio-android-sdk-5\n```\n\nI am currently updating the library to catchup with all changes published on the latest Android and iOS Twilio Voice SDK:\n\n[iOS changelog](https://www.twilio.com/docs/voice/voip-sdk/ios/changelog)\n[Android changelog](https://www.twilio.com/docs/voice/voip-sdk/android/3x-changelog)\n\nMy plan is to use the following links as a reference, and follow Twilio commit by commit.\n\n- https://github.com/twilio/voice-quickstart-android\n- https://github.com/twilio/voice-quickstart-ios\n\n_If you want to contribute please consider helping on this project. [Click here for more information](https://github.com/hoxfon/react-native-twilio-programmable-voice/issues/158)._\n\n### Project 2\n\nAllow Android to use the built in Android telephony service to make and receive calls.\n\n## Stable release\n\n### Twilio Programmable Voice SDK\n\n- Android 4.5.0\n- iOS 5.2.0\n\n### Breaking changes in v4.0.0\n\nThe module implements [react-native autolinking](https://github.com/react-native-community/cli/blob/master/docs/autolinking.md) as many other native libraries \u003e react-native 0.60.0, therefore it doesn't need to be linked manually.\n\nAndroid: update Firebase Messaging to 17.6.+. Remove the following block from your application's `AndroidManifest.xml` if you are migrating from v3.\n\n```xml\n    \u003c!-- [START instanceId_listener] --\u003e\n    \u003cservice\n        android:name=\"com.hoxfon.react.TwilioVoice.fcm.VoiceFirebaseInstanceIDService\"\n        android:exported=\"false\"\u003e\n        \u003cintent-filter\u003e\n            \u003caction android:name=\"com.google.android.gms.iid.InstanceID\" /\u003e\n        \u003c/intent-filter\u003e\n    \u003c/service\u003e\n    \u003c!-- [END instanceId_listener] --\u003e\n```\n\nAndroid X is supported.\n\nData passed to the event `deviceDidReceiveIncoming` does not contain the key `call_state`, because state of Call Invites was removed in Twilio Android and iOS SDK v3.0.0\n\n- iOS: params changes for `connectionDidConnect` and `connectionDidDisconnect`\n\n    to =\u003e call_to\n    from =\u003e call_from\n    error =\u003e err\n\nNew features\n\nTwilio Programmable Voice SDK v3.0.0 handles call invites directly and makes it easy to distinguish a call invites from an active call, which previously was confusing.\nTo ensure that an active call is displayed when the app comes to foreground you should use the promise `getActiveCall()`.\nTo ensure that a call invite is displayed when the app comes to foreground use the promise `getCallInvite()`. Please note that call invites don't have a `call_state` field.\n\nYou should use `hold()` to put a call on hold.\n\nYou can be notified when a call is `ringing` by listening for `callStateRinging` events.\n\niOS application can now receive the following events, that in v3 where only dispatched to Android:\n\n- deviceDidReceiveIncoming\n- callInviteCancelled\n- callStateRinging\n- connectionIsReconnecting\n- connectionDidReconnect\n\n### Breaking changes in v3.0.0\n\n- initWitToken returns an object with a property `initialized` instead of `initilized`\n- iOS event `connectionDidConnect` returns the same properties as Android\nmove property `to` =\u003e `call_to`\nmove property `from` =\u003e `call_from`\n\n### Installation\n\nBefore starting, we recommend you get familiar with [Twilio Programmable Voice SDK](https://www.twilio.com/docs/api/voice-sdk).\nIt'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.\n\n```bash\nnpm install react-native-twilio-programmable-voice --save\n```\n\n- **React Native 0.60+**\n\n[CLI autolink feature](https://github.com/react-native-community/cli/blob/master/docs/autolinking.md) links the module while building the app.\n\n- **React Native \u003c= 0.59**\n\n```bash\nreact-native link react-native-twilio-programmable-voice\n```\n\n### iOS Installation\n\nIf you can't or don't want to use autolink, you can also manually link the library using the instructions below (click on the arrow to show them):\n\n\u003cdetails\u003e\n\u003csummary\u003eManually link the library on iOS\u003c/summary\u003e\n\nFollow the [instructions in the React Native documentation](https://facebook.github.io/react-native/docs/linking-libraries-ios#manual-linking) to manually link the framework\n\nAfter you have linked the library with `react-native link react-native-twilio-programmable-voice`\ncheck that `libRNTwilioVoice.a` is present under YOUR_TARGET \u003e Build Phases \u003e Link Binaries With Libraries. If it is not present you can add it using the + sign at the bottom of that list.\n\u003c/details\u003e\n\n```bash\ncd ios \u0026\u0026 pod install\n```\n\n#### CallKit\n\nThe iOS library works through [CallKit](https://developer.apple.com/reference/callkit) and handling calls is much simpler than the  Android implementation as CallKit handles the inbound calls answering, ignoring, or rejecting. Outbound calls must be controlled by custom React-Native screens and controls.\n\nTo pass caller's name to CallKit via Voip push notification add custom parameter 'CallerName' to Twilio Dial verb.\n\n```xml\n    \u003cDial\u003e\n    \u003cClient\u003e\n        \u003cIdentity\u003eClient\u003c/Identity\u003e\n        \u003cParameter name=\"CallerName\"\u003eNAME TO DISPLAY\u003c/Parameter\u003e\n    \u003c/Client\u003e\n    \u003c/Dial\u003e\n```\n\n#### VoIP Service Certificate\n\nTwilio 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. Follow [the official Twilio instructions](https://github.com/twilio/voice-quickstart-ios#7-create-voip-service-certificate) to complete this step.\n\n### Android Installation\n\nSetup FCM\n\nYou must download the file `google-services.json` from the Firebase console.\nIt contains keys and settings for all your applications under Firebase. This library obtains the resource `senderID` for registering for remote GCM from that file.\n\n#### `android/build.gradle`\n\n```groovy\nbuildscript {\n    dependencies {\n        // override the google-service version if needed\n        // https://developers.google.com/android/guides/google-services-plugin\n        classpath 'com.google.gms:google-services:4.3.4'\n    }\n}\n\n// this plugin looks for google-services.json in your project\napply plugin: 'com.google.gms.google-services'\n```\n\n#### `AndroidManifest.xml`\n\n```xml\n    \u003cuses-permission android:name=\"android.permission.VIBRATE\" /\u003e\n\n    \u003capplication ....\u003e\n        \u003c!-- Twilio Voice --\u003e\n        \u003c!-- [START fcm_listener] --\u003e\n        \u003cservice\n            android:name=\"com.hoxfon.react.RNTwilioVoice.fcm.VoiceFirebaseMessagingService\"\u003e\n            \u003cintent-filter\u003e\n                \u003caction android:name=\"com.google.firebase.MESSAGING_EVENT\" /\u003e\n            \u003c/intent-filter\u003e\n        \u003c/service\u003e\n        \u003c!-- [END fcm_listener] --\u003e\n```\n\nIf you can't or don't want to use autolink, you can also manually link the library using the instructions below (click on the arrow to show them):\n\n\u003cdetails\u003e\n\u003csummary\u003eManually link the library on Android\u003c/summary\u003e\n\nMake the following changes:\n\n#### `android/settings.gradle`\n\n```groovy\ninclude ':react-native-twilio-programmable-voice'\nproject(':react-native-twilio-programmable-voice').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-twilio-programmable-voice/android')\n```\n\n#### `android/app/build.gradle`\n\n```groovy\ndependencies {\n   implementation project(':react-native-twilio-programmable-voice')\n}\n```\n\n#### `android/app/src/main/.../MainApplication.java`\nOn top, where imports are:\n\n```java\nimport com.hoxfon.react.RNTwilioVoice.TwilioVoicePackage;  // \u003c--- Import Package\n```\n\nAdd the `TwilioVoicePackage` class to your list of exported packages.\n\n```java\n@Override\nprotected List\u003cReactPackage\u003e getPackages() {\n    return Arrays.asList(\n            new MainReactPackage(),\n            new TwilioVoicePackage()         // \u003c---- Add the package\n            // new TwilioVoicePackage(false) // \u003c---- pass false if you don't want to ask for microphone permissions\n    );\n}\n```\n\u003c/details\u003e\n\n## Usage\n\n```javascript\nimport TwilioVoice from 'react-native-twilio-programmable-voice'\n\n// ...\n\n// initialize the Programmable Voice SDK passing an access token obtained from the server.\n// Listen to deviceReady and deviceNotReady events to see whether the initialization succeeded.\nasync function initTelephony() {\n    try {\n        const accessToken = await getAccessTokenFromServer()\n        const success = await TwilioVoice.initWithToken(accessToken)\n    } catch (err) {\n        console.err(err)\n    }\n}\n\nfunction initTelephonyWithToken(token) {\n    TwilioVoice.initWithAccessToken(token)\n\n    // iOS only, configure CallKit\n    try {\n        TwilioVoice.configureCallKit({\n            appName:       'TwilioVoiceExample',                  // Required param\n            imageName:     'my_image_name_in_bundle',             // OPTIONAL\n            ringtoneSound: 'my_ringtone_sound_filename_in_bundle' // OPTIONAL\n        })\n    } catch (err) {\n        console.err(err)\n    }\n}\n```\n\n## Events\n\n```javascript\n// add listeners (flowtype notation)\nTwilioVoice.addEventListener('deviceReady', function() {\n    // no data\n})\nTwilioVoice.addEventListener('deviceNotReady', function(data) {\n    // {\n    //     err: string\n    // }\n})\nTwilioVoice.addEventListener('connectionDidConnect', function(data) {\n    // {\n    //     call_sid: string,  // Twilio call sid\n    //     call_state: 'CONNECTED' | 'ACCEPTED' | 'CONNECTING' | 'RINGING' | 'DISCONNECTED' | 'CANCELLED',\n    //     call_from: string, // \"+441234567890\"\n    //     call_to: string,   // \"client:bob\"\n    // }\n})\nTwilioVoice.addEventListener('connectionIsReconnecting', function(data) {\n    // {\n    //     call_sid: string,  // Twilio call sid\n    //     call_from: string, // \"+441234567890\"\n    //     call_to: string,   // \"client:bob\"\n    // }\n})\nTwilioVoice.addEventListener('connectionDidReconnect', function(data) {\n    // {\n    //     call_sid: string,  // Twilio call sid\n    //     call_from: string, // \"+441234567890\"\n    //     call_to: string,   // \"client:bob\"\n    // }\n})\nTwilioVoice.addEventListener('connectionDidDisconnect', function(data: mixed) {\n    //   | null\n    //   | {\n    //       err: string\n    //     }\n    //   | {\n    //         call_sid: string,  // Twilio call sid\n    //         call_state: 'CONNECTED' | 'ACCEPTED' | 'CONNECTING' | 'RINGING' | 'DISCONNECTED' | 'CANCELLED',\n    //         call_from: string, // \"+441234567890\"\n    //         call_to: string,   // \"client:bob\"\n    //         err?: string,\n    //     }\n})\nTwilioVoice.addEventListener('callStateRinging', function(data: mixed) {\n    //   {\n    //       call_sid: string,  // Twilio call sid\n    //       call_state: 'CONNECTED' | 'ACCEPTED' | 'CONNECTING' | 'RINGING' | 'DISCONNECTED' | 'CANCELLED',\n    //       call_from: string, // \"+441234567890\"\n    //       call_to: string,   // \"client:bob\"\n    //   }\n})\nTwilioVoice.addEventListener('callInviteCancelled', function(data: mixed) {\n    //   {\n    //       call_sid: string,  // Twilio call sid\n    //       call_from: string, // \"+441234567890\"\n    //       call_to: string,   // \"client:bob\"\n    //   }\n})\n\n// iOS Only\nTwilioVoice.addEventListener('callRejected', function(value: 'callRejected') {})\n\nTwilioVoice.addEventListener('deviceDidReceiveIncoming', function(data) {\n    // {\n    //     call_sid: string,  // Twilio call sid\n    //     call_from: string, // \"+441234567890\"\n    //     call_to: string,   // \"client:bob\"\n    // }\n})\n\n// Android Only\nTwilioVoice.addEventListener('proximity', function(data) {\n    // {\n    //     isNear: boolean\n    // }\n})\n\n// Android Only\nTwilioVoice.addEventListener('wiredHeadset', function(data) {\n    // {\n    //     isPlugged: boolean,\n    //     hasMic: boolean,\n    //     deviceName: string\n    // }\n})\n\n// ...\n\n// start a call\nTwilioVoice.connect({To: '+61234567890'})\n\n// hangup\nTwilioVoice.disconnect()\n\n// accept an incoming call (Android only, in iOS CallKit provides the UI for this)\nTwilioVoice.accept()\n\n// reject an incoming call (Android only, in iOS CallKit provides the UI for this)\nTwilioVoice.reject()\n\n// ignore an incoming call (Android only)\nTwilioVoice.ignore()\n\n// mute or un-mute the call\n// mutedValue must be a boolean\nTwilioVoice.setMuted(mutedValue)\n\n// put a call on hold\nTwilioVoice.hold(holdValue)\n\n// send digits\nTwilioVoice.sendDigits(digits)\n\n// Ensure that an active call is displayed when the app comes to foreground\nTwilioVoice.getActiveCall()\n    .then(activeCall =\u003e {\n        if (activeCall){\n            _displayActiveCall(activeCall)\n        }\n    })\n\n// Ensure that call invites are displayed when the app comes to foreground\nTwilioVoice.getCallInvite()\n    .then(callInvite =\u003e {\n        if (callInvite){\n            _handleCallInvite(callInvite)\n        }\n    })\n\n// Unregister device with Twilio (iOS only)\nTwilioVoice.unregister()\n```\n\n## Help wanted\n\nThere is no need to ask permissions to contribute. Just open an issue or provide a PR. Everybody is welcome to contribute.\n\nReactNative 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.\n\n![help wanted](images/vjeux_tweet.png \"help wanted\")\n\n## Twilio Voice SDK reference\n\n[iOS changelog](https://www.twilio.com/docs/voice/voip-sdk/ios/changelog)\n[Android changelog](https://www.twilio.com/docs/voice/voip-sdk/android/3x-changelog)\n\n## Credits\n\n[voice-quickstart-android](https://github.com/twilio/voice-quickstart-android)\n\n[voice-quickstart-ios](https://github.com/twilio/voice-quickstart-ios)\n\n[react-native-push-notification](https://github.com/zo0r/react-native-push-notification)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoxfon%2Freact-native-twilio-programmable-voice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhoxfon%2Freact-native-twilio-programmable-voice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoxfon%2Freact-native-twilio-programmable-voice/lists"}