twilio / twilio-voice-react-native

Other
72 stars 27 forks source link

Version 1.0.0 - Put on hold does not display up-to-date information about the call #351

Open dev3whistlebiz opened 6 months ago

dev3whistlebiz commented 6 months ago

Issue

Call is put on hold but invoking connection.isOnHold() returns false.

Pre-submission Checklist

Description

While having a call and receiving another call on iOS it will show 3 buttons: "End & Accept", "Reject" and "Hold & Accept". When "Hold & Accept" button is pressed then call is put on hold which is good but invoking connection.isOnHold() returns false.

Reproduction Steps

  1. Call to someone.
  2. Receive other call.
  3. Press "Hold & Accept"
  4. In the code invoking connection.isOnHold() returns false.

Expected Behavior

Invoking connection.isOnHold() returns whether call is on hold or not.

Actual Behavior

Invoking connection.isOnHold() returns incorrect data.

Reproduction Frequency

100%

Screenshots

If applicable, add screenshots to help explain your problem.

Software and Device Information

Please complete the following information.

Additional Context

I implemented setInterval for 1000 ms in order to check return value of connection.isOnHold() calling. It would be nice to have some event like Call.Event.OnHold by the way.

mhuynh5757 commented 6 months ago

Hi @dev3whistlebiz thanks for bringing this to our attention. I've filed an internal ticket to discuss this with the team.

dev3whistlebiz commented 6 months ago

@mhuynh5757 thanks for the response! Looking forward to any updates.

mhuynh5757 commented 6 months ago

For the event feature request, does the return value of call.hold() not suffice? I understand that this won't work when the iOS native UI is handling the hold, but I'd like to understand the other use cases you have.

dev3whistlebiz commented 6 months ago

@mhuynh5757 Main idea is to know that native screen has put connection on hold and to have up-to-date data for example to manage internal state of application properly. Thanks for quick response!

mhuynh5757 commented 6 months ago

That sounds reasonable. I'll file an internal ticket and discuss this with the team. I cannot share any information about timelines at this point, but we will take a look!

dev3whistlebiz commented 6 months ago

@mhuynh5757 thanks for response! I hope bugfix for put on hold will come out soon since the only way to know if call is on hold for user is to use his ears :). Thank you!

dev3whistlebiz commented 6 months ago

Is there any new info about it available?

bobiechen-twilio commented 6 months ago

Hi @dev3whistlebiz

While we were investigating we also tried the following steps:

From the Xcode debugger breakpoint we did see that the iOS CallKit framework did notify the SDK that the call will be put on hold when hold-and-accepting the second call, and the call.isOnHold() did return true.

Do you observe the same behavior using the example app in your dev enviornment?

dev3whistlebiz commented 6 months ago

Hello @bobiechen-twilio. Thanks for the response. When I am accepting regular call I don't put on hold previous connection but I am clicking "Accept & Hold" button on iOS. I am using Expo in my application. Call is put on hold, but unfortunately invoking call.isOnHold() is not returning me true in my application. I am invoking call.isOnHold() in setInverval every second if that would help you in your investigation.

dev3whistlebiz commented 5 months ago

Hello, any updates?

bobiechen-twilio commented 5 months ago

@dev3whistlebiz

The SDK puts the iOS native SDK call object on hold when an iOS callback is triggered by the action of hold-and-accept, which should reflect next time call.isOnHold() is called. If it's not too much trouble setting up iOS debugging session in Xcode, could you set up breakpoints here and let us know if the call object is still in the map? https://github.com/twilio/twilio-voice-react-native/blob/main/ios/TwilioVoiceReactNative.m#L733

dev3whistlebiz commented 5 months ago

Hello @bobiechen-twilio! Sorry for a delay in response. Please see below:

The SDK puts the iOS native SDK call object on hold when an iOS callback is triggered by the action of hold-and-accept

This is true and works like you mentioned, but invoking call.isOnHold() always returns false (a few times it was returning me undefined).

If it's not too much trouble setting up iOS debugging session in Xcode, could you set up breakpoints here and let us know if the call object is still in the map?

I am sorry, I am using Expo and developing on Windows. I am eagerly looking for any kind of updates on this ticket. Thank you very much for the response!

bobiechen-twilio commented 5 months ago

Thanks for the confirming the details @dev3whistlebiz Please note that Expo is not officially validated with the React Native binding provided in this repository. However you can still look into a couple of places in the JS source to diagnose why the information is not properly propagated to the React Native layer. @mhuynh5757 any thoughts?

dev3whistlebiz commented 5 months ago

@bobiechen-twilio I have also tried to log response of call.isOnHold when I am clicking mute button in my application, and it still returns me false even though on native screen call is actually on hold. Please let me know if there is any updates available. Thanks!

dev3whistlebiz commented 5 months ago

Any updates on this one?

mhuynh5757 commented 5 months ago

Hi @dev3whistlebiz this one is tough since we're not able to reproduce this issue on our end. It also seems like we're not able to get debug logs considering your dev environment, so pinning this one down is hard. How are you running and building the app on Windows? Unless I'm mistaken, you need Xcode to build and run on the iOS platform? Is there no way to get the native logs in your setup?

dev3whistlebiz commented 5 months ago

Hello @mhuynh5757 ! Thanks for the response!

I am using Expo for development and developing with real phones. Expo allows to make builds for iOS and Android platforms. On native screen it is actually holds the call and user is not going to be able to hear anything, but on my call screen I want to show that call was put on hold, so I am calling call.isOnHold() to see if call was put on hold and update state of screen. Unfortunately in this case it is returning me false or undefined. When I am invoking console.log('IS ON HOLD?', call.isOnHold()) every second and putting call on hold on application screen it is returning me whatever the current state is but when I am putting call on hold in this specific scenario ("Hold & Accept") it is 99% of the time returning me false and the other 1% it is undefined. I also tried to logging it in the same way when pressing "Mute" button in my application after I pressed "Hold & Accept" button on native screen and it is 100% of the time returning me false. Thank you for looking into this, I really appreciate it! Any feedback will be super nice to have!

mhuynh5757 commented 5 months ago

Hi @dev3whistlebiz are you using Expo Go? Is it possible for you to make a development build instead, if you are? It would be nice to confirm if the same issue is present in both development builds and on Go.

dev3whistlebiz commented 5 months ago

Hello @mhuynh5757, thanks for the quick response! I am making development builds and testing in development/stage modes by logging result of call.isOnHold() in the interval or when mute button is pressed.

dev3whistlebiz commented 5 months ago

Any updates?