5

I have implemented Web RTC and it's working perfectly. The problem is that when the application is not opened—or terminated state—and when I receive a call, I am not able to pass my voice to the other user, while I am able to listen. I have configured the AVAudioSession before CXAnswer call delegate.

func configureAudioSession() {
    let sharedSession = AVAudioSession.sharedInstance()
    do {
        try sharedSession.setCategory(AVAudioSession.Category.playAndRecord)
        try sharedSession.setMode(AVAudioSession.Mode.voiceChat)
        try sharedSession.setPreferredIOBufferDuration(TimeInterval(0.005))
        try sharedSession.setPreferredSampleRate(44100.0)
    } catch {
        debugPrint("Failed to configure `AVAudioSession`")
}
func provider(_ provider: CXProvider, perform action: CXAnswerCallAction) {

    guard let call = ProviderDelegate.callManager.callWithUUID(action.callUUID) else {
        action.fail()
        return
    }

    configureAudioSession()

    call.answer { error in
        if let error = error {
            print("ERROR: failed to answer: \(error.localizedDescription)")
        }
        action.fulfill()
    }
}
Marco
  • 1,572
  • 1
  • 10
  • 21
argus7
  • 95
  • 1
  • 11
  • 1
    did you find any solution to to your problem? I am also facing similar issue in iOS13 – Shahid Iqbal Jun 22 '20 at 21:24
  • ** The issue is not resolved yet ** The issue is not happening when we create a room from a mobile device and accept with another mobile device it's only happening when we create a room from website and accept the call on a mobile device on the lock or killed state of the application – argus7 Oct 27 '20 at 07:37

0 Answers0