Twilio Voice iOS SDK: `callInvite is lacking` when accepting incoming name from CallKit or React Native

0
2
Twilio Voice iOS SDK: `callInvite is lacking` when accepting incoming name from CallKit or React Native


I am integrating Twilio Voice (v6.12.1) into my React Native app (utilizing Swift bridging for iOS) and have carried out full VoIP, PushKit, and CallKit assist for incoming calls.


What works:

  • Incoming calls set off the VoIP push and show the full-screen CallKit interface (or fallback UI).
  • Decline Name works as anticipated.
  • Name logs and occasions print appropriately.

Downside:

When I attempt to settle for the decision utilizing the CallKit Settle for button or React Native fallback UI, I constantly get:

[TwilioVoiceModule] answerCall() callInvite is lacking

I additionally observed that the console logs for answerCall() are being printed 3 times in a row, regardless that the settle for button is barely pressed as soon as.


Observations:

  • The callInvite is correctly acquired when the VoIP push arrives.
  • However when answerCall() is triggered, callInvite turns into nil.
  • This occurs in CallKit settle for, RN UI settle for, and even notification banner settle for.

📦 The way it’s arrange (summarized):

1. PushKit Registration – by way of PKPushRegistry in AppDelegate.swift

2. VoIP push dealing with – forwards payload to TwilioVoiceModule.handleIncomingPush()

3. CallKit integration – makes use of CXProviderDelegate to report and deal with settle for actions

4. JS Bridge – emits acceptCallAction to JS

5. React Native calls TwilioVoiceModule.answerCall(uuid, callSid)

6. In answerCall() technique: self.callInvite is nil – so name can’t be accepted.

Attaching the hyperlink to view the related code: https://docs.google.com/doc/d/15pNjKrfk954OaotpMIEh3xQUtst—1K45DBXoYctGM/edit?usp=sharing


Name Settle for Circulate (iOS):

  1. VoIP Push → TwilioVoiceModule.handleIncomingPush()
  2. Twilio SDK creates callInvite
  3. reportNewIncomingCall() triggers CallKit UI
  4. On settle for: CXAnswerCallAction → emits occasion to JS
  5. RN calls TwilioVoiceModule.answerCall(uuid, callSid)
  6. Downside: callInvite is already nil

What I am making an attempt to know:

  • Why is callInvite lacking when accepting the decision, and the way can I make sure that answerCall() is triggered solely as soon as?

Setting:

  • React Native 0.78.x
  • iOS 17+
  • Swift bridging with TwilioVoiceModule.swift
  • Twilio Voice SDK 6.12.1
  • PushKit + CallKit + react-native-callkeep

LEAVE A REPLY

Please enter your comment!
Please enter your name here