Reputation: 21
When a call is initiated when the app is in background or in a completely closed state, the callkeep UI is invoked. When the call is accepted, the required behavior is that it must open our app and callkeep must handle the call through background and it must show the app's screen to the user instead of the callkeep UI.
I'm using the RNCallKeep.backToForeground()
function for that.
RNCallKeep.addEventListener('answerCall', () => {
RNCallKeep.backToForeground();
// Navigating to the required page on app after this.
});
RNCallKeep.backToForeground()
is supposed to display the application in foreground if the application was in background state and run the callkeep in background.
The RNCallKeep.backToForeground()
invokes the app and navigates to the necessary screen when a call is answered (Although sometimes even this behavior is random, and it doesn't open the app always) but then the audio stops going through. The mic is active as it shows that the phone is using your microphone, but audio is not captured by the microphone.
I'm using Agora to connect VOIP calls, the audio issue only comes up while using Callkeep and not when we handle the calls ourselves, so maybe Callkeep is interfering with agora's audio channels.
Note: This is only happening on Android, not on iOS devices.
Upvotes: 2
Views: 411