User guide

The Interruption Life Cycle
Figure 3-1 illustrates the sequence of events before, during, and after an audio session interruption for a
playback app.
Figure 3-1 An audio session gets interrupted
An interruption event—in this example, the arrival of a phone call—proceeds as follows. The numbered steps
correspond to the numbers in the figure.
1.
Your app is active, playing back audio.
2.
A phone call arrives. The system activates the phone apps audio session.
3.
The system deactivates your audio session. At this point, playback in your app has stopped.
4.
The system invokes your interruption listener callback function indicating that your session has been
deactivated.
5.
Your callback takes appropriate action. For example, it could update the user interface and save the
information needed to resume playback at the point where it stopped.
6.
If the user dismisses the interruption—electing to ignore an incoming phone call in this case—the system
invokes your callback method, indicating that the interruption has ended.
7.
Your callback takes action appropriate to the end of an interruption. For example, it updates the user
interface, reactivates your audio session, and resumes playback.
8.
(Not shown in the figure.) If, instead of dismissing the interruption at step (6), the user accepted a phone
call, your app is suspended. When the phone call ends, the end interruption is delivered.
Responding to Interruptions
The Interruption Life Cycle
2014-09-17 | Copyright © 2014 Apple Inc. All Rights Reserved.
28