<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "watchOS: 7.3.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NearbyInteraction",
  "identifier" : "/documentation/NearbyInteraction/NINearbyObject/discoveryToken",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Nearby Interaction"
    ],
    "preciseIdentifier" : "c:objc(cs)NINearbyObject(py)discoveryToken"
  },
  "title" : "discoveryToken"
}
-->

# discoveryToken

A unique identifier for a peer device in the session.

```
@NSCopying var discoveryToken: NIDiscoveryToken { get }
```

## Discussion

The value of this property refers to a specific peer device. Your session delegate receives updates for a peer’s position in your delegate’s [`session(_:didUpdate:)`](/documentation/NearbyInteraction/NISessionDelegate/session(_:didUpdate:)) implementation. To correspond the updates to an iPhone or Apple Watch among multiple peer devices with which your app interacts, compare the value of this property to the configuration’s [`peerDiscoveryToken`](/documentation/NearbyInteraction/NINearbyPeerConfiguration/peerDiscoveryToken). For interactions with third-party accessories, compare the value of this property to the configuration’s [`accessoryDiscoveryToken`](/documentation/NearbyInteraction/NINearbyAccessoryConfiguration/accessoryDiscoveryToken).

Subsequent sessions with the same peer device produce a different value for this property. For user privacy, the system assigns this property a unique, random number to prevent correlation between this property and a particular device.

---

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)