Missing audio when start app from killed state

Hi supporters!
I have 2 apps Doctor App and Patient App and using Callkit to handle video call between 2 apps. Our steps:

  1. When Doctor call Patient (app Patient in background)
  2. Callkit screen show then Patient accept call
  3. Video call screen show in Patient App and 2 apps connect with each other.

Now there are some issues happen.

  1. Sometimes Doctor app or Patient app is missing audio (some time include video)
  2. Audio comes from internal speaker

Please help!

1 Like

To make audio comes through speaker, we need to override default port to speaker like this

do {
            try AVAudioSession.sharedInstance().overrideOutputAudioPort(.speaker)
        } catch {
            print("======== Error OverrideOutputAudioPort \(error.localizedDescription)")
        }