Contents

allowBluetooth

An option that determines whether Bluetooth hands-free devices appear as available input routes.

Declaration

static var allowBluetooth: AVAudioSession.CategoryOptions { get }

Discussion

You’re required to set this option to allow routing audio input and output to a paired Bluetooth Hands-Free Profile (HFP) device. If you clear this option, paired Bluetooth HFP devices don’t show up as available audio input routes.

If an application uses the setPreferredInput(_:) method to select a Bluetooth HFP input, the output automatically changes to the corresponding Bluetooth HFP output. Likewise, selecting a Bluetooth HFP output using an MPVolumeView object’s route picker automatically changes the input to the corresponding Bluetooth HFP input. Therefore, both audio input and output are routed to the Bluetooth HFP device even though you only selected the input or output.

You can set this option only if the audio session category is playAndRecord or record.

See Also

Category options