Overview
When a user leaves your call view controller, iOS may suspend it to free resources. Proper background handling:- Keeps the call session active in the background
- Maintains audio/video streams
- Allows users to return to the call seamlessly
When to Use
| Scenario | Solution |
|---|---|
| User stays in call view | No action needed |
| User presses HOME during call | Use Background Modes |
| User switches to another app | Use Background Modes |
| User locks device during call | Use Background Modes |
| Receiving calls when app is killed | VoIP Calling handles this |
Background Handling is different from VoIP Calling. VoIP handles receiving calls when the app is not running. Background Handling keeps an active call alive when the user leaves the app.
Enable Background Modes
In Xcode, add the following background modes to your app: 1. Go to your target’s “Signing & Capabilities” tab 2. Add “Background Modes” capability 3. Enable the following modes:- Audio, AirPlay, and Picture in Picture
- Voice over IP
The Calls SDK automatically handles audio session configuration. You only need to enable the background modes capability.
Related Documentation
- VoIP Calling - Receive calls when app is killed
- Events - Session status events