<!--
{
  "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",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Nearby Interaction"
    ],
    "preciseIdentifier" : "s:SC11NIErrorCodeLeV"
  },
  "title" : "NIError"
}
-->

# NIError

An error Nearby Interaction reports.

```
struct NIError
```

## Overview

Implement the [`session(_:didInvalidateWith:)`](/documentation/NearbyInteraction/NISessionDelegate/session(_:didInvalidateWith:)) callback to check for errors.

## Topics

### Comparing errors

### Inspecting error information

### Identifying an error cause

[`enum Code`](/documentation/NearbyInteraction/NIError/Code)

Codes that identify errors in Nearby Interaction.

[`static var activeSessionsLimitExceeded: NIError.Code`](/documentation/NearbyInteraction/NIError/activeSessionsLimitExceeded)

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

[`static var invalidConfiguration: NIError.Code`](/documentation/NearbyInteraction/NIError/invalidConfiguration)

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

[`static var resourceUsageTimeout: NIError.Code`](/documentation/NearbyInteraction/NIError/resourceUsageTimeout)

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

[`static var sessionFailed: NIError.Code`](/documentation/NearbyInteraction/NIError/sessionFailed)

An error code that indicates that the session failed.

[`static var unsupportedPlatform: NIError.Code`](/documentation/NearbyInteraction/NIError/unsupportedPlatform)

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

[`static var userDidNotAllow: NIError.Code`](/documentation/NearbyInteraction/NIError/userDidNotAllow)

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

[`static var invalidARConfiguration: NIError.Code`](/documentation/NearbyInteraction/NIError/invalidARConfiguration)

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

[`static var activeExtendedDistanceSessionsLimitExceeded: NIError.Code`](/documentation/NearbyInteraction/NIError/activeExtendedDistanceSessionsLimitExceeded)

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

[`static var incompatiblePeerDevice: NIError.Code`](/documentation/NearbyInteraction/NIError/incompatiblePeerDevice)

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

[`static var accessoryPeerDeviceUnavailable: NIError.Code`](/documentation/NearbyInteraction/NIError/accessoryPeerDeviceUnavailable)

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

### Type Properties

[`static var errorDomain: String`](/documentation/NearbyInteraction/NIError/errorDomain)

## Relationships

### Conforms To

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

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

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

[`CustomNSError`](/documentation/Foundation/CustomNSError)

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

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

---

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)