CallKit Display and Audio Output Mismatch with Unintended UI Reversion

I'm building a React Native call application using the following combination of libraries:

https://github.com/react-native-webrtc/react-native-callkeep

https://github.com/react-native-webrtc/react-native-webrtc

https://github.com/react-native-webrtc/react-native-voip-push-notification

When I press the speaker button on the call screen displayed by CallKit and change it to ON, the speaker button display on the call screen reverts back to OFF after a few seconds.

However, when the speaker button display reverts to OFF, the actual audio output route does not return to the earpiece - the audio continues to output from the speaker without any change.

Could you please advise on what cases might cause the speaker button display to revert, and if there are any potential solutions?

When I press the speaker button on the call screen displayed by CallKit and change it to ON, the speaker button display on the call screen reverts back to OFF after a few seconds.

However, when the speaker button display reverts to OFF, the actual audio output route does not return to the earpiece - the audio continues to output from the speaker without any change.

Could you please advise on what cases might cause the speaker button display to revert, and if there are any potential solutions?

I can't tell you exactly what's gone wrong, but the basic answer is that there's an issue with how your audio code is managing your audio session. I suspect that you're not handling the initial route change properly, our Call UI updates based on that, then you complete the route change, which Call UI is "missing".

For reference, our Speakerbox sample app is a "full" CallKit implementation* and, if you experiment with it you'll find that it doesn't have any of these issues. Correct your audio implementation and the interface will correct itself.

*It's basically a fake call app built on CallKit.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

CallKit Display and Audio Output Mismatch with Unintended UI Reversion
 
 
Q