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?

CallKit Display and Audio Output Mismatch with Unintended UI Reversion
 
 
Q