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

# NISession

An object that identifies a unique connection between two peer devices.

```
class NISession
```

## Overview

This class represents the central mechanism to interact with nearby objects, for example, a peer Apple device or third-party accessory. After creating an [`NISession`](/documentation/NearbyInteraction/NISession) for a nearby object, the app interacts with the object by receiving [`NISessionDelegate`](/documentation/NearbyInteraction/NISessionDelegate) callbacks.

One session represents an interaction between the user and a single nearby object. To interact with multiple nearby objects, create a separate session for each.

For more information, see [Initiating and maintaining a session](/documentation/NearbyInteraction/initiating-and-maintaining-a-session).

## Topics

### Ensuring feature support

[`deviceCapabilities`](/documentation/NearbyInteraction/NISession/deviceCapabilities)

An object that communicates the device’s supported framework features.

[`NIDeviceCapability`](/documentation/NearbyInteraction/NIDeviceCapability)

An interface that adds Boolean values that indicate an interaction session feature support.

### Connecting to a peer device

[`discoveryToken`](/documentation/NearbyInteraction/NISession/discoveryToken)

A temporary, random identifier for a device.

[`NIDiscoveryToken`](/documentation/NearbyInteraction/NIDiscoveryToken)

An object that uniquely identifies a peer that participates in an interaction session.

[`-  runWithConfiguration:`](/documentation/NearbyInteraction/NISession/run(_:))

Starts a session with a nearby peer.

[`configuration`](/documentation/NearbyInteraction/NISession/configuration)

The configuration run by the session.

[`delegateQueue`](/documentation/NearbyInteraction/NISession/delegateQueue)

The dispatch queue on which the session invokes delegate callbacks.

### Managing life cycle

[`delegate`](/documentation/NearbyInteraction/NISession/delegate)

An object that the framework notifies of session events.

[`-  pause`](/documentation/NearbyInteraction/NISession/pause())

Stops sending distance and direction updates to the peer.

[`-  invalidate`](/documentation/NearbyInteraction/NISession/invalidate())

Stops a running session.

### Utilizing Camera Assistance

[`-  setARSession:`](/documentation/NearbyInteraction/NISession/setARSession(_:))

Provides the framework with an existing AR session to use for Camera Assistance.

[`worldTransform(for:)`](/documentation/NearbyInteraction/NISession/worldTransform(for:))

Returns a world transform to integrate a nearby object in an AR experience.

[`-  worldTransformForObject:`](/documentation/NearbyInteraction/NISession/worldTransformForObject:)

Returns a world transform to integrate a nearby object in an AR experience.

[`NINearbyObjectWorldTransformNotAvailable`](/documentation/NearbyInteraction/NINearbyObjectWorldTransformNotAvailable)

A constant that indicates that the framework is unable to provide a world transform for a nearby object.

### Providing accessory state information

[`-  updateMotionState:forObjectWithToken:`](/documentation/NearbyInteraction/NISession/updateMotionState(_:forObjectWithToken:))

Notifies the session of an accessory’s motion state change.

[`NIMotionActivityState`](/documentation/NearbyInteraction/NIMotionActivityState)

Motion states for a nearby accessory.

### Deprecated

[`supported`](/documentation/NearbyInteraction/NISession/isSupported)

A Boolean value that indicates whether the device supports basic interaction-session functionality.

## Relationships

### Conforms To

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

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

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

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

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

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

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)