@exolve/react-native-voice-sdk
v1.6.0
Published
React Native wrapper for Exolve Mobile Voice SDK
Downloads
78
Readme
@exolve/react-native-voice-sdk
Exolve React Native Voice SDK allows you to make phone calls in your application.
Full SDK API usage shown in our demo app.
See https://community.exolve.ru for more information.
Installation
The package is available through npm.
yarn add @exolve/react-native-voice-sdk
Usage
Register account:
import { RegistrationEvent, Communicator, LogLevel } from '@exolve/react-native-voice-sdk';
const communicator = new Communicator();
communicator.initialize({
logConfiguration: { logLevel: LogLevel.Debug },
enableNotifications: true
});
const callClient = communicator.callClient();
// Set up listenting for registration events (see RegistrationEvent enum)
callClient.on(RegistrationEvent.Registered, ({stateName}) => {
console.debug('RegistrationEvent.Registered');
});
// Register with SIP credentials from your Exolve account
callClient.registerAccount(username, password);
Make call:
// Set up listening for call events (see CallEvent enum)
callClient.on(CallEvent.New, (call: Call) => {
console.debug(`CallEvent.New id: ${call.id}`);
// Handle new call (incoming and outgoing)
});
// Start outgoing call
callClient.makeCall(phone_number);