I'm integrating Twilio Voice (v6.12.1) into my React Native app (using Swift bridging for iOS) and have implemented full VoIP, PushKit, and CallKit support for incoming calls.
✅ What works:
Incoming calls trigger the VoIP push and display the full-screen CallKit interface (or fallback UI). Decline Call works as expected. Call logs and events print correctly.
❌ Problem:
When I try to accept the call using the CallKit Accept button or React Native fallback UI, I consistently get:
❌ [TwilioVoiceModule] answerCall() callInvite is missing.
I also noticed that the console logs for answerCall() are being printed three times in a row, even though the accept button is only pressed once. Additionally in the first time console, answerCall() CallInvite found, accepting...
🔍 Observations:
The callInvite is properly received when the VoIP push arrives. But when answerCall() is triggered, callInvite becomes nil. This happens in CallKit accept, RN UI accept, and even notification banner accept.
📦 How it's set up (summarized):
-
PushKit Registration – via PKPushRegistry in AppDelegate.swift
-
VoIP push handling – forwards payload to TwilioVoiceModule.handleIncomingPush()
-
CallKit integration – uses CXProviderDelegate to report and handle accept actions
-
JS Bridge – emits acceptCallAction to JS
-
React Native calls TwilioVoiceModule.answerCall(uuid, callSid)
-
In answerCall() method: self.callInvite is nil – so call cannot be accepted.
Attaching the link to view the relevant code: https://docs.google.com/document/d/15pNjKrfk954OaotpMIEh3xQUtst---1K45DBXoYctGM/edit?usp=sharing
💡 Call Accept Flow (iOS):
VoIP Push → TwilioVoiceModule.handleIncomingPush() Twilio SDK creates callInvite reportNewIncomingCall() triggers CallKit UI On accept: CXAnswerCallAction → emits event to JS RN calls TwilioVoiceModule.answerCall(uuid, callSid) Problem: callInvite is already nil
❓ What I'm trying to understand:
- Why is callInvite becoming nil before answerCall() is called?
- Why are the logs showing the answerCall() call 3 times?
- Is there a race condition or multiple accept triggers?
- Should I ensure callInvite is accepted only once across all 3 accept paths?
** 💬 Any help would be appreciated.**
📱 Environment:
- React Native 0.78.x
- iOS 17+
- Swift bridging with TwilioVoiceModule.swift
- Twilio Voice SDK 6.12.1
- PushKit + CallKit + react-native-callkeep