react-native-twilioo
v1.0.0
Published
A React Native wrapper for the Twilio mobile SDK
Downloads
7
Maintainers
Readme
A React Native wrapper for the Twilio mobile SDK
Installation iOS
- Run
npm install react-native-twilio --save
in your project directory - Open your project in XCode, right click on
Libraries
and clickAdd Files to "Your Project Name"
- Within
node_modules
, findreact-native-twilio/ios
and add RCTTwilio.xcodeproj to your project. - Add
libRCTTwilio.a
toBuild Phases -> Link Binary With Libraries
Installation Android
Coming Soon... PR anyone?
Usage
Have a look at the Twilio Client SDK for details.
const Twilio = require('react-native-twilio');
...
componentWillMount() {
Twilio.initWithTokenUrl('https://example.com/token');
// or
Twilio.initWithToken('sometoken');
Twilio.addEventListener('deviceDidStartListening', this._deviceDidStartListening);
Twilio.addEventListener('deviceDidStopListening', this._deviceDidStopListening);
Twilio.addEventListener('deviceDidReceiveIncoming', this._deviceDidReceiveIncoming);
Twilio.addEventListener('connectionDidStartConnecting', this._connectionDidStartConnecting);
Twilio.addEventListener('connectionDidConnect', this._connectionDidConnect);
Twilio.addEventListener('connectionDidDisconnect', this._connectionDidDisconnect);
Twilio.addEventListener('connectionDidFail', this._connectionDidFail);
}
...
Twilio.connect({To: '+61234567890'});
Twilio.disconnect();
Twilio.accept();
Twilio.reject();
Twilio.ignore();