How to use the react-native-voximplant.Voximplant.CallEvents function in react-native-voximplant

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 / 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 / screens / CallScreen.js View on Github external
setupListeners() {
        if (this.call) {
            Object.keys(Voximplant.CallEvents).forEach((eventName) => {
                const callbackName = `_onCall${eventName}`;
                if (typeof this[callbackName] !== 'undefined') {
                    this.call.on(eventName, this[callbackName]);
                }
            });
            if (this.isIncoming) {
                this.call.getEndpoints().forEach(endpoint => {
                    this._setupEndpointListeners(endpoint, true);
                });
            }
        }
    }
github voximplant / react-native-demo / src / screens / IncomingCallScreen.js View on Github external
componentWillUnmount() {
        if (this.call) {
            Object.keys(Voximplant.CallEvents).forEach((eventName) => {
                const callbackName = `_onCall${eventName}`;
                if (typeof this[callbackName] !== 'undefined') {
                    this.call.off(eventName, this[callbackName]);
                }
            });
            this.call = null;
        }
    }