user1256821 user1256821 - 18 days ago 10
Swift Question

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.

Answer

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.