Callkit loudspeaker bug / how WhatsApp fixed it?

痞子三分冷 提交于 2019-12-03 01:23:06

There is a workaround proposed by an apple engineer which should fix callkit not activating the audio session correctly:

a workaround would be to configure your app's audio session (call configureAudioSession()) earlier in your app's lifecycle, before the -provider:performAnswerCallAction: method is invoked. For instance, you could call configureAudioSession() immediately before calling -[CXProvider reportNewIncomingCallWithUUID:update:completion:] in order to ensure that the audio session is fully configured prior to informing CallKit about the incoming call.

From: https://forums.developer.apple.com/thread/64544#189703

If this doesn't help, you probably should post an example project which reproduces your behaviour for us to be able to analyse it further.

Britto Thomas

Referd from Abnormal behavior of speaker button on system provided call screen

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.

Please go through the apple developer forum

CallKit/detect speaker set

and

[CALLKIT] audio session not activating?

Maybe you can setMode to AVAudioSessionModeDefault.

When I use CallKit + WebRTC

  1. I configure AVAudioSessionModeDefault mode.

  2. Alloc CXProvider and reportNewIncomingCallWithUUID

  3. Use WebRTC , after ICEConnected, WebRTC change mode to AVAudioSessionModeVoiceChat, then speaker issue happen.

  4. Later I setMode back to AVAudioSessionModeDefault, the speaker works well.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!