twilio / twilio-voice-react-native

Other
74 stars 29 forks source link

[IOS] If app is in killed state, How to accept or reject incoming call in IOS? #405

Open himanshupkarak opened 2 months ago

himanshupkarak commented 2 months ago

Issue

Accept and Reject buttons are not working, If received an incoming call on killed state in IOS

Pre-submission Checklist

Description

accept and reject not working for killed state incoming call in IOS.

Reproduction Steps

Expected Behavior

User can accept or reject incoming call from IOS native UI screen.

Actual Behavior

can not accept or reject

Reproduction Frequency

In my case, It's 100%

Screenshots

Software and Device Information

Please complete the following information.

Additional Context

mhuynh5757 commented 2 months ago

Hi @himanshupkarak are you experiencing crashes or are you not seeing UI pop up when attempting to receive an incoming call? Are you able to receive incoming calls when the app is not in the killed state? If you experiencing crashes, please provide Xcode logs. Finally, can you confirm that you're using a real iOS device, and not the iOS simulator? The Twilio Voice SDKs will not work on iOS simulators.

himanshupkarak commented 2 months ago

HI @mhuynh5757 i am not experiencing any crash on incoming call with any state (foreground, background or killed) not even after accepting or rejecting call.

the issue is (only for killed state), when i click on accept (from IOS native UI) my call decline if i click on reject (2 times), my call also decline

*here are some screenshots to understand more.

WhatsApp Image 2024-08-22 at 14 16 24 WhatsApp Image 2024-08-22 at 14 16 29

one more thing,

-> voice.addListener(Voice.Event.CallInvite, handlePendingCallInvite);

-> callInvite.on(CallInvite.Event.Accepted, async (res) => { console.log('check response', res) })


please help!!

himanshupkarak commented 2 months ago

yes, I am using a real iOS device

mhuynh5757 commented 2 months ago

Thanks for the update @himanshupkarak. When CallInvites are accepted through the native UI and the JS runtime is not started, for example when your app is backgrounded or closed, you are indeed correct that the callInvite.on(CallInvite.Event.Accepted, ...) event will not fire. Instead, on JS runtime start, you should invoke voice.getCalls() to get all ongoing calls. Please see how our test app does this: https://github.com/twilio/twilio-voice-react-native/blob/main/test/app/src/hook.ts#L479

ayazalphasquad commented 1 week ago

hi @mhuynh5757 - I'm facing a similar issue with my app in the killed state. I've integrated the react-native-callkeep package along with PushKit and CallKit to handle the UI, and it works fine in the foreground and background modes. But, when the app is killed, it crashes because the listeners are in the JavaScript layer.

I am unable to view the Xcode console logs since the app disconnects with the xCode as soon as it's terminated/killed. Could you please assist me with this issue?

Hi @himanshupkarak - Response from your side would also be appreciated.

himanshupkarak commented 1 week ago

Hi @ayazalphasquad, I will let you know, BTW i am still having this issue