setPrefersInterruptionOnRouteDisconnect(_:)
Sets a preference to interrupt the audio session when the active route disconnects.
Declaration
func setPrefersInterruptionOnRouteDisconnect(_ inValue: Bool) throwsParameters
Discussion
The expected behavior of an app is to pause playback if a route change occurs due to a device no longer being available (AVAudioSession.RouteChangeReason.oldDeviceUnavailable). Starting in iOS 17, the system interrupts active Now Playing sessions when a route change occurs due to a disconnection event, but doesn’t interrupt other sessions.