Type Property

allowBluetooth

Determines whether Bluetooth handsfree devices appear as available input routes.

Declaration

static var allowBluetooth: AVAudioSession.CategoryOptions { get }

Discussion

Setting this option is required to allow routing audio input and output to a paired Bluetooth Hands-Free Profile (HFP) device. If this option is cleared, paired Bluetooth HFP do not show up as available audio input routes.

If an application uses the setPreferredInput(_:) method to select a Bluetooth HFP input, the output will automatically be changed to the corresponding Bluetooth HFP output. Likewise, selecting a Bluetooth HFP output using an MPVolumeView object's route picker, will automatically change the input to the corresponding Bluetooth HFP input. Therefore, both audio input and output will always be routed to the Bluetooth HFP device even though only the input or output was selected.

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