MrHertal / react-native-twilio-phone

Twilio Voice React Native module.
MIT License
154 stars 67 forks source link

How to show native UI after accepting call on iOS #20

Closed se1exin closed 3 years ago

se1exin commented 3 years ago

Hi, I've been playing with this lib and on Android it works seamlessly. However on iOS (iPhone 6s - 13.5.1) when receiving an incoming call it initially shows the native Reject/Accept UI as the device rings, but as soon as the call is accepted the native UI disappears and the App UI shows.

In this comment on issue #3 you do mention that on iOS this is default behaviour, however in the screenshots in the readme I can see you have it displaying the native UI of an active call. How can we achieve this?

I've tried invoking RNCallKeep.displayIncomingCall inside the CallConnected event like follows with no luck.

twilioPhoneEmitter.addListener(EventType.CallConnected, () => {
    RNCallKeep.displayIncomingCall(RNTwilioPhone.calls[0].uuid, '0422222222', 'test');
});

Any ideas how we can keep the Native Call UI on screen for the entire duration of the call?

(Also on a side note, you should register for GitHub sponsors - I would sponsor you for this project as it is going to save me a LOT of time)

MrHertal commented 3 years ago

Many thanks @se1exin for offering sponsorship 🙂 I have completed registration and you can now sponsor 🙏

I have looked for a way to achieve this but unfortunately there seems to be none.

When starting an outgoing call on iOS, native UI is not displayed.

When receiving an incoming call, native UI appears in background. Users have to display all opened apps and select it, that's what I did to take the snapshot in the README.

If you want to avoid this, you can build your own UI in your app and use the TwilioPhone API.

se1exin commented 3 years ago

@MrHertal thank you for your response (and sorry for my late response!).

Thanks for confirming - looks like there is no way out of building more UI... Seeing as I'm going to build a call UI for iOS anyway, perhaps it would be a useful PR for this project?

P.s. enjoy the beer 🍻 😉

MrHertal commented 3 years ago

Thanks @se1exin ! I really appreciate 🙂🍻

Yes it would be a very good PR on the example app! A good start would be managing one call because managing multiple calls with hold and mute etc. could be very challenging.

iarmankhan commented 2 years ago

Hey @MrHertal Can you provide any example or docs to build out custom UI for this? Thanks

MrHertal commented 2 years ago

Hi @iarmankhan , this is a question about React Native in general.

In the example app you will find a very basic UI to make a call.

chuonglv2 commented 2 years ago

@MrHertal Firstly I wanna say thank you. Your work almost saves our project. I am building a custom UI when making calls or receiving calls but don't know how to disable/hide the UI of the OS. Can you provide any examples or docs for this issue?