How to use react-native-voximplant - 10 common examples

To help you get started, we’ve selected a few react-native-voximplant examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github voximplant / react-native-demo / src / manager / LoginManager.js View on Github external
constructor() {
        this.client = Voximplant.getInstance();
        // Connection to the Voximplant Cloud is stayed alive on reloading of the app's
        // JavaScript code. Calling "disconnect" API here makes the SDK and app states
        // synchronized.
        PushManager.init();
        (async() => {
            try {
                this.client.disconnect();
            } catch (e) {

            }
        })();
        this.client.on(Voximplant.ClientEvents.ConnectionClosed, this._connectionClosed);
    }
github voximplant / react-native-demo / src / manager / LoginManager.js View on Github external
constructor() {
        this.client = Voximplant.getInstance();
        // Connection to the Voximplant Cloud is stayed alive on reloading of the app's
        // JavaScript code. Calling "disconnect" API here makes the SDK and app states
        // synchronized.
        PushManager.init();
        (async() => {
            try {
                this.client.disconnect();
            } catch (e) {

            }
        })();
        this.client.on(Voximplant.ClientEvents.ConnectionClosed, this._connectionClosed);
    }
github voximplant / react-native-demo / UserAgent.js View on Github external
cancelCall() {
    console.log("Cancel call");
    VoxImplant.SDK.disconnectCall(currentCallId);
  }
github aryaminus / RN-voice-video-call / app / components / Register.js View on Github external
"&api_key=" +
        api_key +
        "&user_id=" +
        user_id +
        "&application_id=all"
    );
    const jsonB = await responseB.json();
    const result = JSON.stringify(jsonB.result);
    console.log(result);
    
    const accnameValue = "testing";
    const appnameValue = "testing";
    const passwordValue = password;

    //login the user to get deviceeventemitter
    VoxImplant.SDK.login(
      usernameValue +
        "@" +
        appnameValue +
        "." +
        accnameValue +
        ".voximplant.com",
      passwordValue
    );

    this.setState({ loading: false });
    this.props.navigation.navigate("Boiler");
  }
github voximplant / react-native-demo / UserAgent.js View on Github external
TouchableOpacity,
  Platform,
  DeviceEventEmitter,
  Image
} from 'react-native';
import { Keypad } from './Keypad';
import { CallButton } from './CallButton';
import { IncomingCallForm } from './IncomingCallForm';
import VoxImplant from "react-native-voximplant";
import loginManager from './LoginManager';

var	currentCallId,
    uaInstance,
    number = '',
    settings_video = false,
    camera = VoxImplant.SDK.CameraType.CameraTypeFront;

DeviceEventEmitter.addListener(
  VoxImplant.SDK.Events.CallRinging,
  (callRinging) => {
    console.log('Call ringing. Call id = ' + callRinging.callId);
    if (uaInstance !== undefined) {
      uaInstance.setState({callState: "Ringing"});
    }
  }
);

DeviceEventEmitter.addListener(
  VoxImplant.SDK.Events.CallConnected,
  (callConnected) => {
    console.log('Call connected. Call id = ' + callConnected.callId);
    if (uaInstance !== undefined) {
github aryaminus / RN-voice-video-call / App.js View on Github external
async VoxImplant() {
    const accnameValue = "testing";
    const appnameValue = "testing";
    const email = await AsyncStorage.getItem("email");
    const usernameValue = email.replace(/@[^@]+$/, "");
    const passwordValue = await AsyncStorage.getItem("password");
    console.log(email);
    //console.log(passwordValue);
    VoxImplant.SDK.login(
      usernameValue +
        "@" +
        appnameValue +
        "." +
        accnameValue +
        ".voximplant.com",
      passwordValue
    );
    console.log("SDK Login done");
  }
github aryaminus / RN-voice-video-call / app / components / Boiler.js View on Github external
makeCall(event) {
    console.log("calling " + number);
    VoxImplant.SDK.createCall(
      number,
      settings_video,
      null,
      function(callId) {
        currentCallId = callId;
        if (settings_p2p)
          VoxImplant.SDK.startCall(callId, { "X-DirectCall": "true" });
        else VoxImplant.SDK.startCall(callId);
        this.setState(
          update(this.state, {
            $merge: {
              status: "calling"
            }
          })
        );
      }.bind(this)
github voximplant / react-native-demo / src / manager / CallManager.js View on Github external
startOutgoingCallViaCallKit(isVideo, number) {
        this.callKitManager.startOutgoingCall(isVideo, number, this.call.callId);
        this.call.on(Voximplant.CallEvents.Connected, this._callConnected);
        this.call.on(Voximplant.CallEvents.Disconnected, this._callDisconnected);
    }
github voximplant / react-native-demo / src / manager / CallManager.js View on Github external
_incomingCall = (event) => {
        if (this.call !== null) {
            console.log(`CallManager: incomingCall: already have a call, rejecting new call, current call id: ${this.call.callId}`);
            event.call.decline();
            return;
        }

        this.addCall(event.call);
        this.call.on(Voximplant.CallEvents.Disconnected, this._callDisconnected);
        if (Platform.OS === 'ios') {
            if (this.currentAppState === 'active') {
                console.log('CallManager: _incomingCall: report incoming call to CallKit');
                this.callKitManager.showIncomingCall(event.video, event.call.getEndpoints()[0].displayName, event.call.callId);
            } else {
                console.log('CallManager: _incomingCall: application is in the background, incoming call is already reported in AppDelegate');
                this.callKitManager.callId = event.call.callId;
                this.callKitManager.withVideo = event.video;
            }
        } else {
            this._showIncomingScreenOrNotification(event);
        }
    };
github voximplant / react-native-demo / src / manager / CallKitManager.js View on Github external
_onRNCallKeepDidActivateAudioSession = () => {
        console.log('CallKitManager: _onRNCallKeepDidActivateAudioSession');
        Voximplant.Hardware.AudioDeviceManager.getInstance().callKitStartAudio();
    };