Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Make Outgoing Calls Using Twilio Voice React Native SDK in Expo Managed Workflow #437

Open
ihorMarynichZazmic opened this issue Oct 16, 2024 · 5 comments

Comments

@ihorMarynichZazmic
Copy link

Description
I'm unable to make outgoing calls using Twilio Voice React Native SDK in Expo Managed Workflow. The following error appears when attempting to make a call:

Error: Failed to initialize PushKit device token
I'm currently focusing on outgoing calls only, but I plan to add support for incoming calls later.

Reproduction Steps
Generate Twilio Access Token using generateTwillioVoiceAccessToken.
Attempt to make an outgoing call using voice.connect().
The error message related to PushKit appears.
Expected Behavior
I expect outgoing calls to work without requiring PushKit initialization.

Actual Behavior
Outgoing calls fail due to PushKit initialization errors, despite not needing incoming calls functionality.

Reproduction Frequency
Occurs 100% of the time.

Software and Device Information
Device: iPhone 12
OS: iOS 16
React version: 18.2.0
React Native version: 0.74.3
Node version: 18.20.4
npm version: 9.6.7

Additional Context
I'm currently using the SDK only for outgoing calls. However, I plan to add incoming calls support in the future. How can I bypass PushKit initialization for now to enable outgoing calls only?

@bobiechen-twilio
Copy link
Collaborator

Hi @ihorMarynichZazmic

Thanks for reaching out.
The PushKit error message is only printed/returned when using the Voice.register() (or unregister()) method which should not block the app from making outbound calls using the Voice.connect() method.

@ihorMarynichZazmic
Copy link
Author

Hi @bobiechen-twilio
Thank you for the clarification! I’m currently using the Expo Managed Workflow, focusing solely on outbound calls for now, but I plan to integrate incoming call functionality in the future. I understand that the PushKit error shouldn't affect making outbound calls. However, after calling voice.connect(), the call is not initiated, and there are no errors shown in the console. Could there be additional steps or configurations needed specifically for Expo? Thanks again for your help!

@bobiechen-twilio
Copy link
Collaborator

Did you see any exception or did the promise not returning any error?
Also are you able to run the app using the Xcode debugger and see if there are additional debug messages?

@ihorMarynichZazmic
Copy link
Author

ihorMarynichZazmic commented Oct 16, 2024

@bobiechen-twilio
Thank you for the response!

I don’t see any exceptions, and the promise isn’t returning any errors. Here's the code I'm using for making the outbound call:

`const makeCall = async () => {
try {
console.log('Checking for Twilio token');
if (!twilioToken) {
console.error('Twilio token is missing');
return;
}

console.log('Starting call with number:', '**********');
const call = await voice.connect(twilioToken, {
  params: { To: '**********' },
});

console.log('Call connected, call state:', call);
setCallStatus('Call connected');

call.on(Voice.Event.Disconnected, () => {
  console.log('Call disconnected');
  setCallStatus('Call disconnected');
});

} catch (error) {
console.error('Error making the call', error);
}
};`

I reach the state where the log prints console.log('Starting call with number:', '**********'); but after that, nothing happens, and no errors are returned.

@bobiechen-twilio
Copy link
Collaborator

Hi @ihorMarynichZazmic

Are you able to run the app from the Xcode debugger? At this point we might need the debug messages from the native ObjC layer in case something went wrong here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants