Pick the fix
The user unplugs their headphones while a podcast plays. What should happen?
Hint 1 of 1
Which notification tells you the route changed?
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A Observe AVAudioSession.routeChangeNotification and pause when the reason is oldDeviceUnavailable
Correct. Apple expects playback to pause, so audio doesn't suddenly come from the speaker.
Why not the others?
- B Keep playing through the speaker. That surprises users in public.
- C Stop and reset to the beginning. Users lose their place.
- D Do nothing, because the system pauses for you. The app must handle it.