<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NearbyInteraction",
  "identifier" : "/documentation/NearbyInteraction/NINearbyAccessoryConfiguration/init(bluetoothChannelSoundingIdentifier:previousBluetoothIdentifier:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Nearby Interaction"
    ],
    "preciseIdentifier" : "c:objc(cs)NINearbyAccessoryConfiguration(im)initWithBluetoothChannelSoundingIdentifier:previousBluetoothIdentifier:"
  },
  "title" : "init(bluetoothChannelSoundingIdentifier:previousBluetoothIdentifier:)"
}
-->

# init(bluetoothChannelSoundingIdentifier:previousBluetoothIdentifier:)

Initializes a configuration for Bluetooth Channel Sounding ranging with an accessory.

```
init(bluetoothChannelSoundingIdentifier bluetoothIdentifier: UUID, previousBluetoothIdentifier: UUID?)
```

## Parameters

`bluetoothIdentifier`

An identifier that the session uses to establish the Bluetooth connection with the accessory. This identifier originates from the Bluetooth Channel Sounding protocol.

`previousBluetoothIdentifier`

An optional previous Bluetooth identifier for reconnection scenarios.

## Discussion

Bluetooth Channel Sounding is a Bluetooth 6.0 specification ranging strategy that measure distance between iPhone and a paired accessory over a standard Bluetooth connection without requiring dedicated Ultra Wideband hardware.

Use this initializer to create an accessory configuration that implements Bluetooth Channel Sounding. Call [`supportsBluetoothChannelSounding`](/documentation/NearbyInteraction/NIDeviceCapability/supportsBluetoothChannelSounding) before running a session to ensure device support, and pair your accessory with <doc://com.apple.documentation/documentation/AccessorySetupKit>; the Nearby Interaction framework only supports Bluetooth Channel Sounding with accessories paired through <doc://com.apple.documentation/documentation/AccessorySetupKit>.

### Handle reconnections

When reconnecting to an accessory where the Bluetooth identifier can change, provide the previous identifier using the `previousBluetoothIdentifier` parameter. This allows the session to maintain internal state continuity across reconnections. For initial connections, pass `nil` for this parameter.

```swift
// Initial connection.
let config = NINearbyAccessoryConfiguration(
    bluetoothChannelSoundingIdentifier: btcsIdentifier,
    previousBluetoothIdentifier: nil
)
session.run(config)

// Reconnection with a new identifier.
let reconnectConfig = NINearbyAccessoryConfiguration(
    bluetoothChannelSoundingIdentifier: newBtcsIdentifier,
    previousBluetoothIdentifier: previousBtcsIdentifier
)
session.run(reconnectConfig)
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)