How to use the react-native-callkeep.addEventListener function in react-native-callkeep

To help you get started, we’ve selected a few react-native-callkeep 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 react-native-webrtc / react-native-callkeep / example / App.js View on Github external
useEffect(() => {
    RNCallKeep.addEventListener('answerCall', answerCall);
    RNCallKeep.addEventListener('didPerformDTMFAction', didPerformDTMFAction);
    RNCallKeep.addEventListener('didReceiveStartCallAction', didReceiveStartCallAction);
    RNCallKeep.addEventListener('didPerformSetMutedCallAction', didPerformSetMutedCallAction);
    RNCallKeep.addEventListener('didToggleHoldCallAction', didToggleHoldCallAction);
    RNCallKeep.addEventListener('endCall', endCall);

    return () => {
      RNCallKeep.removeEventListener('answerCall', answerCall);
      RNCallKeep.removeEventListener('didPerformDTMFAction', didPerformDTMFAction);
      RNCallKeep.removeEventListener('didReceiveStartCallAction', didReceiveStartCallAction);
      RNCallKeep.removeEventListener('didPerformSetMutedCallAction', didPerformSetMutedCallAction);
      RNCallKeep.removeEventListener('didToggleHoldCallAction', didToggleHoldCallAction);
      RNCallKeep.removeEventListener('endCall', endCall);
    }
  }, []);
github cern-phone-apps / desktop-phone-app / mobile / src / calls / providers / PhoneProvider / PhoneProvider.js View on Github external
() => {
        this.addListeners();
        RNCallKeep.addEventListener(
          'didReceiveStartCallAction',
          this.onNativeCall
        );
        RNCallKeep.addEventListener('answerCall', () => {
          logMessage('Received answerCall event');
          this.onAnswerCallAction();
        });
        RNCallKeep.addEventListener('endCall', this.hangUpCurrentCallAction);
        RNCallKeep.addEventListener(
          'didDisplayIncomingCall',
          this.onIncomingCallDisplayed
        );
      }
    );
github react-native-webrtc / react-native-callkeep / example / App.js View on Github external
useEffect(() => {
    RNCallKeep.addEventListener('answerCall', answerCall);
    RNCallKeep.addEventListener('didPerformDTMFAction', didPerformDTMFAction);
    RNCallKeep.addEventListener('didReceiveStartCallAction', didReceiveStartCallAction);
    RNCallKeep.addEventListener('didPerformSetMutedCallAction', didPerformSetMutedCallAction);
    RNCallKeep.addEventListener('didToggleHoldCallAction', didToggleHoldCallAction);
    RNCallKeep.addEventListener('endCall', endCall);

    return () => {
      RNCallKeep.removeEventListener('answerCall', answerCall);
      RNCallKeep.removeEventListener('didPerformDTMFAction', didPerformDTMFAction);
      RNCallKeep.removeEventListener('didReceiveStartCallAction', didReceiveStartCallAction);
      RNCallKeep.removeEventListener('didPerformSetMutedCallAction', didPerformSetMutedCallAction);
      RNCallKeep.removeEventListener('didToggleHoldCallAction', didToggleHoldCallAction);
      RNCallKeep.removeEventListener('endCall', endCall);
    }
  }, []);
github voximplant / react-native-demo / src / manager / CallKitManager.js View on Github external
constructor() {
        const options = {
            ios: {
                appName: 'VoximplantDemo',
            },
        };
        RNCallKeep.setup(options);

        RNCallKeep.addEventListener('didReceiveStartCallAction', this._onRNCallKeepDidReceiveStartCallAction);
        RNCallKeep.addEventListener('answerCall', this._onRNCallKeepPerformAnswerCallAction);
        RNCallKeep.addEventListener('endCall', this._onRNCallKeepPerformEndCallAction);
        RNCallKeep.addEventListener('didActivateAudioSession', this._onRNCallKeepDidActivateAudioSession);
        RNCallKeep.addEventListener('didDisplayIncomingCall', this._onRNCallKeepDidDisplayIncomingCall);
        RNCallKeep.addEventListener('didPerformSetMutedCallAction', this._onRNCallKeepDidPerformSetMutedCallAction);
    }
github cern-phone-apps / desktop-phone-app / mobile / src / calls / providers / PhoneProvider / PhoneProvider.js View on Github external
() => {
        this.addListeners();
        RNCallKeep.addEventListener(
          'didReceiveStartCallAction',
          this.onNativeCall
        );
        RNCallKeep.addEventListener('answerCall', () => {
          logMessage('Received answerCall event');
          this.onAnswerCallAction();
        });
        RNCallKeep.addEventListener('endCall', this.hangUpCurrentCallAction);
        RNCallKeep.addEventListener(
          'didDisplayIncomingCall',
          this.onIncomingCallDisplayed
        );
      }
    );
github cern-phone-apps / desktop-phone-app / mobile / src / calls / providers / PhoneProvider / PhoneProvider.js View on Github external
() => {
        this.addListeners();
        RNCallKeep.addEventListener(
          'didReceiveStartCallAction',
          this.onNativeCall
        );
        RNCallKeep.addEventListener('answerCall', () => {
          logMessage('Received answerCall event');
          this.onAnswerCallAction();
        });
        RNCallKeep.addEventListener('endCall', this.hangUpCurrentCallAction);
        RNCallKeep.addEventListener(
          'didDisplayIncomingCall',
          this.onIncomingCallDisplayed
        );
      }
    );
github voximplant / react-native-demo / src / manager / CallKitManager.js View on Github external
constructor() {
        const options = {
            ios: {
                appName: 'VoximplantDemo',
            },
        };
        RNCallKeep.setup(options);

        RNCallKeep.addEventListener('didReceiveStartCallAction', this._onRNCallKeepDidReceiveStartCallAction);
        RNCallKeep.addEventListener('answerCall', this._onRNCallKeepPerformAnswerCallAction);
        RNCallKeep.addEventListener('endCall', this._onRNCallKeepPerformEndCallAction);
        RNCallKeep.addEventListener('didActivateAudioSession', this._onRNCallKeepDidActivateAudioSession);
        RNCallKeep.addEventListener('didDisplayIncomingCall', this._onRNCallKeepDidDisplayIncomingCall);
        RNCallKeep.addEventListener('didPerformSetMutedCallAction', this._onRNCallKeepDidPerformSetMutedCallAction);
    }
github cern-phone-apps / desktop-phone-app / mobile / src / calls / providers / PhoneProvider / PhoneProvider.js View on Github external
() => {
        this.addListeners();
        RNCallKeep.addEventListener(
          'didReceiveStartCallAction',
          this.onNativeCall
        );
        RNCallKeep.addEventListener('answerCall', () => {
          logMessage('Received answerCall event');
          this.onAnswerCallAction();
        });
        RNCallKeep.addEventListener('endCall', this.hangUpCurrentCallAction);
        RNCallKeep.addEventListener(
          'didDisplayIncomingCall',
          this.onIncomingCallDisplayed
        );
      }
    );
github react-native-webrtc / react-native-callkeep / example / App.js View on Github external
useEffect(() => {
    RNCallKeep.addEventListener('answerCall', answerCall);
    RNCallKeep.addEventListener('didPerformDTMFAction', didPerformDTMFAction);
    RNCallKeep.addEventListener('didReceiveStartCallAction', didReceiveStartCallAction);
    RNCallKeep.addEventListener('didPerformSetMutedCallAction', didPerformSetMutedCallAction);
    RNCallKeep.addEventListener('didToggleHoldCallAction', didToggleHoldCallAction);
    RNCallKeep.addEventListener('endCall', endCall);

    return () => {
      RNCallKeep.removeEventListener('answerCall', answerCall);
      RNCallKeep.removeEventListener('didPerformDTMFAction', didPerformDTMFAction);
      RNCallKeep.removeEventListener('didReceiveStartCallAction', didReceiveStartCallAction);
      RNCallKeep.removeEventListener('didPerformSetMutedCallAction', didPerformSetMutedCallAction);
      RNCallKeep.removeEventListener('didToggleHoldCallAction', didToggleHoldCallAction);
      RNCallKeep.removeEventListener('endCall', endCall);
    }
  }, []);
github react-native-webrtc / react-native-callkeep / example / App.js View on Github external
useEffect(() => {
    RNCallKeep.addEventListener('answerCall', answerCall);
    RNCallKeep.addEventListener('didPerformDTMFAction', didPerformDTMFAction);
    RNCallKeep.addEventListener('didReceiveStartCallAction', didReceiveStartCallAction);
    RNCallKeep.addEventListener('didPerformSetMutedCallAction', didPerformSetMutedCallAction);
    RNCallKeep.addEventListener('didToggleHoldCallAction', didToggleHoldCallAction);
    RNCallKeep.addEventListener('endCall', endCall);

    return () => {
      RNCallKeep.removeEventListener('answerCall', answerCall);
      RNCallKeep.removeEventListener('didPerformDTMFAction', didPerformDTMFAction);
      RNCallKeep.removeEventListener('didReceiveStartCallAction', didReceiveStartCallAction);
      RNCallKeep.removeEventListener('didPerformSetMutedCallAction', didPerformSetMutedCallAction);
      RNCallKeep.removeEventListener('didToggleHoldCallAction', didToggleHoldCallAction);
      RNCallKeep.removeEventListener('endCall', endCall);
    }
  }, []);