Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const didReceiveStartCallAction = ({ handle }) => {
if (!handle) {
// @TODO: sometime we receive `didReceiveStartCallAction` with handle` undefined`
return;
}
const callUUID = getNewUuid();
addCall(callUUID, handle);
log(`[didReceiveStartCallAction] ${callUUID}, number: ${handle}`);
RNCallKeep.startCall(callUUID, handle, handle);
BackgroundTimer.setTimeout(() => {
log(`[setCurrentCallActive] ${format(callUUID)}, number: ${handle}`);
RNCallKeep.setCurrentCallActive(callUUID);
}, 1000);
};
const answerCall = ({ callUUID }) => {
const number = calls[callUUID];
log(`[answerCall] ${format(callUUID)}, number: ${number}`);
RNCallKeep.startCall(callUUID, number, number);
BackgroundTimer.setTimeout(() => {
log(`[setCurrentCallActive] ${format(callUUID)}, number: ${number}`);
RNCallKeep.setCurrentCallActive(callUUID);
}, 1000);
};
startOutgoingCall(isVideoCall, displayName, callId) {
this.callKitUuid = uuid.v4();
this.withVideo = isVideoCall;
this.callId = callId;
RNCallKeep.startCall(this.callKitUuid, displayName, displayName, 'generic', isVideoCall);
}