Abnormal behavior of speaker button on system provided call screen

4k views Asked by At

We write VoIP application using CallKit and PortSIP and here is a problem is reproduced only on iOS 11.2.x. When user taps speaker button on CallKit provided screen system enables speaker but icon remains in disabled state. If user taps again system also turns speaker on and forgets about button. To disable speaker user should tap button twice. Has anybody met this bug? And what was your solution? (:

Thanks.

2

There are 2 answers

0
RJV Kumar On BEST ANSWER

The same issue has been experienced in the previous versions as well. So this is not the new issue happening on the call kit.

This issue has to be resolved from iOS. We don't have any control over this.

11
Алексей Смольский On
    RTCDispatcher.dispatchAsync(on: RTCDispatcherQueueType.typeAudioSession) {
        let audioSession = RTCAudioSession.sharedInstance()
        audioSession.lockForConfiguration()
        let configuration = RTCAudioSessionConfiguration.webRTC()
        configuration.categoryOptions = [AVAudioSessionCategoryOptions.allowBluetoothA2DP,AVAudioSessionCategoryOptions.duckOthers,
                                         AVAudioSessionCategoryOptions.allowBluetooth]
        try? audioSession.setConfiguration(configuration)
        audioSession.unlockForConfiguration()
    }

It helps me for CallKit. Speaker button works as expected.