How to use the react-native-callkeep.setup 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 LFSCamargo / Chatify / packages / app / src / screens / Chat / ChatsList.tsx View on Github external
const ChatList = (props: Props) => {
  const { loading, error, me, chats } = props.data
  const [isFetchingEnd, setFetchingEnd] = React.useState(false)

  const sendRTCMessage = Apollo.useMutation(WEBRTC_SEND_MESSAGE)

  RNCallKit.setup({
    ios: {
      appName: 'Chatify',
    },
    android: {
      alertTitle: 'Permissions required',
      alertDescription: 'This application needs to access your phone accounts',
      cancelButton: 'Cancel',
      okButton: 'ok',
    },
  })

  console.log(props)

  React.useEffect(() => {
    if (!loading && !error) {
      if (props.chattingUser === '') {
github react-native-webrtc / react-native-callkeep / example / App.js View on Github external
flexDirection: 'row',
    justifyContent: 'space-between',
    paddingHorizontal: 30,
    width: '100%',
  },
  logContainer: {
    flex: 3,
    width: '100%',
    backgroundColor: '#D9D9D9',
  },
  log: {
    fontSize: 10,
  }
});

RNCallKeep.setup({
  ios: {
    appName: 'CallKeepDemo',
  },
  android: {
     alertTitle: 'Permissions required',
    alertDescription: 'This application needs to access your phone accounts',
    cancelButton: 'Cancel',
    okButton: 'ok',
  },
});

const getNewUuid = () => uuid.v4().toLowerCase();

const format = uuid => uuid.split('-')[0];

const getRandomNumber = () => String(Math.floor(Math.random() * 100000));
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
componentDidMount() {
    const dial = new Dial();
    RNCallKeep.setup(options);
    this.setState(
      {
        toneAPI: dial
      },
      () => {
        this.addListeners();
        RNCallKeep.addEventListener(
          'didReceiveStartCallAction',
          this.onNativeCall
        );
        RNCallKeep.addEventListener('answerCall', () => {
          logMessage('Received answerCall event');
          this.onAnswerCallAction();
        });
        RNCallKeep.addEventListener('endCall', this.hangUpCurrentCallAction);
        RNCallKeep.addEventListener(