Contents

supportsBluetoothChannelSounding

A Boolean value that indicates whether the device supports distance measurements over a Bluetooth connection.

Declaration

var supportsBluetoothChannelSounding: Bool { get }

Discussion

Bluetooth Channel Sounding is a Bluetooth 6.0 specification ranging strategy that relies on a Bluetooth connection to measure distance between iPhone and a paired accessory.

Check this property before using Bluetooth Channel Sounding ranging to ensure the device has the required hardware capabilities. Running a Bluetooth Channel Sounding session on an unsupported device invalidates the session with an error.

To use Bluetooth Channel Sounding,

guard NISession.deviceCapabilities.supportsBluetoothChannelSounding else {
    print("Device doesn't support Bluetooth Channel Sounding.")
    return
}

// Create a configuration for Bluetooth Channel Sounding ranging.
let config = NINearbyAccessoryConfiguration(
    bluetoothChannelSoundingIdentifier: identifier,
    previousBluetoothIdentifier: nil
)
session.run(config)

See Also

Checking session features