Search code examples
iosswiftcallkit

When exactly is CallKit's didActivate called?


When exactly is CallKit's didActivate called?

How should I activate the session?

Official documentation and speakerbox sample do not explain it well.


Solution

  • The audio session is activated by CallKit; that's why they have a callback to tell you that it's been activated. You cannot activate the audio session yourself in the background.

    You need to make sure that the audio session properties (category, mode, etc.) are set up when starting an outgoing call or answering an incoming call, because those things need to be set correctly before CallKit can activate the audio session.