我们使用 CallKit 和 PortSIP 编写 VoIP 应用程序,这是一个仅在 iOS 11.2.x 上重现的问题。当用户点击 CallKit 上的扬声器按钮时,屏幕系统会启用扬声器,但图标仍处于禁用状态。如果用户再次点击系统也会打开扬声器并忘记按钮。要禁用扬声器,用户应点击按钮两次。有人遇到过这个bug吗?你的解决方案是什么?(:
谢谢。
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()
}
它对 CallKit 有帮助。扬声器按钮按预期工作。
在以前的版本中也遇到了同样的问题。所以这不是呼叫套件上发生的新问题。
这个问题必须从 iOS 解决。我们对此没有任何控制权。