<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "watchOS: 7.3.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NearbyInteraction",
  "identifier" : "/documentation/NearbyInteraction/NIError/Code",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Nearby Interaction"
    ],
    "preciseIdentifier" : "c:@E@NIErrorCode"
  },
  "title" : "NIError.Code"
}
-->

# NIError.Code

Codes that identify errors in Nearby Interaction.

```
enum Code
```

## Overview

This enumeration uses [`session(_:didInvalidateWith:)`](/documentation/NearbyInteraction/NISessionDelegate/session(_:didInvalidateWith:)) to collect the errors the framework provides to the delegate.

## Topics

### Errors

[`NIErrorCodeActiveSessionsLimitExceeded`](/documentation/NearbyInteraction/NIError/Code/activeSessionsLimitExceeded)

An error code that indicates that the app reached the maximum number of sessions.

[`NIErrorCodeInvalidConfiguration`](/documentation/NearbyInteraction/NIError/Code/invalidConfiguration)

An error code that indicates that the nearby-interaction configuration isn’t valid.

[`NIErrorCodeResourceUsageTimeout`](/documentation/NearbyInteraction/NIError/Code/resourceUsageTimeout)

An error code that indicates that the framework timed out the session.

[`NIErrorCodeSessionFailed`](/documentation/NearbyInteraction/NIError/Code/sessionFailed)

An error code that indicates that the session failed.

[`NIErrorCodeUnsupportedPlatform`](/documentation/NearbyInteraction/NIError/Code/unsupportedPlatform)

An error code that indicates that the framework doesn’t support the device platform.

[`NIErrorCodeUserDidNotAllow`](/documentation/NearbyInteraction/NIError/Code/userDidNotAllow)

An error code that indicates that the user declined the request to share their relative position with nearby devices.

[`NIErrorCodeInvalidARConfiguration`](/documentation/NearbyInteraction/NIError/Code/invalidARConfiguration)

An error that indicates the framework can’t begin Camera Assistance.

[`NIErrorCodeAccessoryPeerDeviceUnavailable`](/documentation/NearbyInteraction/NIError/Code/accessoryPeerDeviceUnavailable)

An error that indicates the peer Bluetooth accessory isn’t connected or paired.

[`NIErrorCodeIncompatiblePeerDevice`](/documentation/NearbyInteraction/NIError/Code/incompatiblePeerDevice)

An error that indicates the peer device isn’t compatible with this Nearby Interaction session instance.

[`NIErrorCodeActiveExtendedDistanceSessionsLimitExceeded`](/documentation/NearbyInteraction/NIError/Code/activeExtendedDistanceSessionsLimitExceeded)

An error that indicates the device exceeds the available number of active extended distance sessions.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

[`Equatable`](/documentation/Swift/Equatable)

[`Hashable`](/documentation/Swift/Hashable)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

---

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)