---
title: "init(data:)"
framework: homekit
role: symbol
role_heading: Initializer
path: "homekit/hmaccessoryownershiptoken/init(data:)"
---

# init(data:)

Creates an ownership token from data.

## Declaration

```swift
init?(data: Data)
```

## Parameters

- `data`: Data to be sent to the accessory to prove ownership.

## Discussion

Discussion Obtain token data by negotiating with an accessory outside of HomeKit. You typically obtain token data for an accessory that you manufacture. Token creation can fail if the data doesn’t represent a valid ownership token.
