GithubHelp home page GithubHelp logo

nabinem / twilio-voice-react-native Goto Github PK

View Code? Open in Web Editor NEW

This project forked from twilio/twilio-voice-react-native

1.0 0.0 0.0 2.14 MB

License: Other

JavaScript 3.33% Ruby 0.44% C 0.02% Objective-C 17.08% Java 23.28% TypeScript 55.83% Swift 0.02%

twilio-voice-react-native's Introduction

Twilio Voice React Native SDK

NPM

WARNING - PLEASE READ:

This is a Pilot release.

That means:

  • The SDK and associated open source repo are offered as-is. While we take professional pride in all releases, including Pilots, there may be vulnerabilities or bugs present that we’re not yet aware of.
  • We’ve targeted this release to “power users”; documentation is sparse and code samples non-existent. These will come in later (public) releases.
  • Although rare in practice, we reserve the right to introduce breaking API changes in future releases before ultimately going stable/GA.
  • We will tear out the embedded example app and replace it with a proper Quickstart in our first public release. As such, we do not plan to invest any time into fixing or enhancing the current example app.
  • Traditional Twilio Support channels and resources are not available to help.
  • We welcome your feedback and SDK bug reports (note: non-example app bugs) via the issues page.

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. Also, please checkout our common issues page or contact [email protected] if you need technical support.

Prerequisites

Incoming Calls

To allow for incoming calls, you need to create a push credential for Android and iOS. Additionally, for Android, you need to download the google-services.json file from the Firebase console and place it under /app directory.

Access Tokens

An Access Token is required to make outgoing calls or receive incoming calls. Please check out this page for more details on creating Access Tokens.

Installation

The package is available through npm.

yarn add @twilio/voice-react-native-sdk

Usage

The following simple example demonstrates how to make and receive calls. You will need to implement your own getAccessToken() method for it to work properly. Please see Access Tokens section for more details or check out the iOS and Android quickstart for examples on how to generate the tokens. For more information on the Voice React Native SDK API, refer to the API Docs or try running the example app.

import { Voice } from '@twilio/voice-react-native-sdk';

const token = getAccessToken();
const voice = new Voice();

// Allow incoming calls
await voice.register(token);

// Handle incoming calls
voice.on('callInvite', (callInvite) => {
  callInvite.accept();
});

// Make an outgoing call
const call = await voice.connect(token, params);

License

See LICENSE

twilio-voice-react-native's People

Contributors

bobiechen-twilio avatar mhuynh5757 avatar kbagchigwc avatar charliesantos avatar kpchoy avatar snyk-bot avatar twilio-vblocks-ci avatar maheshsinghsawant avatar mluotwilio avatar

Stargazers

Roman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.