How to use the react-native-callkeep.checkIfBusy 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
updateQuery: async (_, { subscriptionData }) => {
          const { callID, type, fromUser, chat, message } = subscriptionData.data.webRTCMessage
          const Busy = await RNCallKit.checkIfBusy()
          if (Busy) {
            await refuseCall(callID, chat._id, CALL_TYPES.BUSY)
          }

          if (type === 'offer') {
            RNCallKit.displayIncomingCall(callID, fromUser, '', 'generic', true)
            RNCallKit.addEventListener('endCall', () =>
              refuseCall(callID, chat._id, CALL_TYPES.REJECT),
            )
            RNCallKit.addEventListener('answerCall', () =>
              answerCall(callID, chat._id, fromUser, message),
            )
          }
        },
      })