---
title: "init(accessoryData:bluetoothPeerIdentifier:)"
framework: nearbyinteraction
role: symbol
role_heading: Initializer
path: "nearbyinteraction/ninearbyaccessoryconfiguration/init(accessorydata:bluetoothpeeridentifier:)"
---

# init(accessoryData:bluetoothPeerIdentifier:)

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

## Declaration

```swift
init(accessoryData: Data, bluetoothPeerIdentifier identifier: UUID) throws
```

## Parameters

- `accessoryData`: The accessory’s configuration data formatted to the https://developer.apple.com/nearby-interaction.
- `identifier`: The accessory’s Bluetooth peer identifier. For more information, see doc://com.apple.documentation/documentation/CoreBluetooth/CBPeer doc://com.apple.documentation/documentation/CoreBluetooth/CBPeer/identifier.

## Mentioned in

Initiating and maintaining a session

## Discussion

Discussion Use this initializer when your app interacts with a Bluetooth accessory that’s paired to the device to enable interaction while your app is in the background.

## See Also

### Creating a configuration for UWB accessories

- [init(data:)](nearbyinteraction/ninearbyaccessoryconfiguration/init(data:).md)
