<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NearbyInteraction",
  "identifier" : "/documentation/NearbyInteraction/NINearbyAccessoryConfiguration",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Nearby Interaction"
    ],
    "preciseIdentifier" : "c:objc(cs)NINearbyAccessoryConfiguration"
  },
  "title" : "NINearbyAccessoryConfiguration"
}
-->

# NINearbyAccessoryConfiguration

A configuration that enables interaction between iPhone and third-party accessories.

```
class NINearbyAccessoryConfiguration
```

## Overview

Use this class to interact with a third-party accessory that you partner with or develop. The framework supports ranging with accessories using either Ultra Wideband (UWB) or Bluetooth Channel Sounding technology.

For an example app that demonstrates this configuration with UWB accessories, see [Implementing spatial interactions with third-party accessories](/documentation/NearbyInteraction/implementing-spatial-interactions-with-third-party-accessories).

### Discover the accessory and create a configuration

To begin the interaction, your app discovers the nearby accessory using a technology you choose — like <doc://com.apple.documentation/documentation/CoreBluetooth>, the local network, or a secure internet connection — and establishes a two-way data link.

For UWB accessories, over the data link, the accessory sends your app configuration data for the [`init(data:)`](/documentation/NearbyInteraction/NINearbyAccessoryConfiguration/init(data:)) initializer. The accessory formats the data according to the [Ultra Wideband (UWB) third-party device specification](https://developer.apple.com/nearby-interaction/specification).

For Bluetooth Channel Sounding accessories in iOS 27 and later, create a configuration using the [`init(bluetoothChannelSoundingIdentifier:previousBluetoothIdentifier:)`](/documentation/NearbyInteraction/NINearbyAccessoryConfiguration/init(bluetoothChannelSoundingIdentifier:previousBluetoothIdentifier:)) initializer with the Bluetooth pairing identifier.

### Enable background interaction for Bluetooth accessories

In iOS 16, third-party UWB accessories paired to the device through Bluetooth can interact with your app while it’s in the background. This enables a new class of hands-free experiences. For example, the person’s phone can be in their pocket and prompt an eBike to power on when mounted, or prompt lights to turn on and music to play as the person enters a room.

To enable background interaction:

- The accessory implements the Bluetooth requirements described in the [Ultra Wideband (UWB) third-party device specification](https://developer.apple.com/nearby-interaction/specification).
- The app connects and pairs to the accessory using <doc://com.apple.documentation/documentation/CoreBluetooth>.
- The app calls the [`init(accessoryData:bluetoothPeerIdentifier:)`](/documentation/NearbyInteraction/NINearbyAccessoryConfiguration/init(accessoryData:bluetoothPeerIdentifier:)) initializer and passes in the accessory’s Bluetooth identifier.

### Start a session and share configuration data

To start a session, the app creates an [`NISession`](/documentation/NearbyInteraction/NISession) instance and passes an instance of this class into the session’s [`run(_:)`](/documentation/NearbyInteraction/NISession/run(_:)) function. For UWB accessories, after your app sets the session [`delegate`](/documentation/NearbyInteraction/NISession/delegate), the system invokes the delegate’s [`session(_:didGenerateShareableConfigurationData:for:)`](/documentation/NearbyInteraction/NISessionDelegate/session(_:didGenerateShareableConfigurationData:for:)) callback and provides your device’s configuration data.

Over the data link, your app sends your device’s configuration data to the UWB accessory, which enables the two devices to start receiving location updates. For Bluetooth Channel Sounding accessories, no configuration data exchange is necessary.

When the system gathers location updates for the accessory, Nearby Interaction calls your delegate’s [`session(_:didUpdate:)`](/documentation/NearbyInteraction/NISessionDelegate/session(_:didUpdate:)) implementation. To match [`distance`](/documentation/NearbyInteraction/NINearbyObject/distance-676dm) updates that your app receives through [`session(_:didUpdate:)`](/documentation/NearbyInteraction/NISessionDelegate/session(_:didUpdate:)) with the accessory, compare the argument object’s discovery token with the value of this property’s [`accessoryDiscoveryToken`](/documentation/NearbyInteraction/NINearbyAccessoryConfiguration/accessoryDiscoveryToken).

### Turn on Precision Finding for stationary objects

In iOS 16, you can combine the visual-spatial power of ARKit with the radio sensitivity of the Ultra Wideband (UWB) chips to locate stationary nearby objects with considerable precision. To do that, set [`isCameraAssistanceEnabled`](/documentation/NearbyInteraction/NINearbyAccessoryConfiguration/isCameraAssistanceEnabled) to `true` and optionally provide the interaction session with an <doc://com.apple.documentation/documentation/ARKit/ARSession> instance through [`setARSession(_:)`](/documentation/NearbyInteraction/NISession/setARSession(_:)) before running the session. Together, the UWB chip and ARKit’s assistance enable Nearby Interaction to provide the same Precision Finding capabilities present in AirTag.

## Topics

### Creating a configuration for UWB accessories

[`init(data:)`](/documentation/NearbyInteraction/NINearbyAccessoryConfiguration/init(data:))

Creates a configuration for interaction between iPhone and third-party accessories.

[`init(accessoryData:bluetoothPeerIdentifier:)`](/documentation/NearbyInteraction/NINearbyAccessoryConfiguration/init(accessoryData:bluetoothPeerIdentifier:))

Creates a configuration for an accessory with the given Bluetooth peer identifier.

### Creating a configuration for Bluetooth Channel Sounding accessories

[`init(bluetoothChannelSoundingIdentifier:previousBluetoothIdentifier:)`](/documentation/NearbyInteraction/NINearbyAccessoryConfiguration/init(bluetoothChannelSoundingIdentifier:previousBluetoothIdentifier:))

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

### Identifying a peer

[`accessoryDiscoveryToken`](/documentation/NearbyInteraction/NINearbyAccessoryConfiguration/accessoryDiscoveryToken)

An identifier for the accessory in a session.

### Turning on Camera Assistance

[`isCameraAssistanceEnabled`](/documentation/NearbyInteraction/NINearbyAccessoryConfiguration/isCameraAssistanceEnabled)

A Boolean value that combines the spatial awareness of ARKit with Nearby Interaction to improve the accuracy of a nearby object’s position.



---

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)