<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NearbyInteraction",
  "identifier" : "/documentation/NearbyInteraction/NISession/setARSession(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Nearby Interaction"
    ],
    "preciseIdentifier" : "c:objc(cs)NISession(im)setARSession:"
  },
  "title" : "setARSession(_:)"
}
-->

# setARSession(_:)

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

```
func setARSession(_ session: ARSession)
```

## Parameters

`session`

An existing AR session configured as follows:

- A world-tracking configuration (<doc://com.apple.documentation/documentation/ARKit/ARWorldTrackingConfiguration>) with <doc://com.apple.documentation/documentation/ARKit/ARConfiguration/worldAlignment-swift.property> `=` <doc://com.apple.documentation/documentation/ARKit/ARConfiguration/WorldAlignment-swift.enum/gravity>, <doc://com.apple.documentation/documentation/ARKit/ARWorldTrackingConfiguration/isCollaborationEnabled> `=` `false`, <doc://com.apple.documentation/documentation/ARKit/ARWorldTrackingConfiguration/userFaceTrackingEnabled> `=` `false`, and <doc://com.apple.documentation/documentation/ARKit/ARWorldTrackingConfiguration/initialWorldMap> `=` `nil`.
- A delegate that returns `false` for <doc://com.apple.documentation/documentation/ARKit/ARSessionObserver/sessionShouldAttemptRelocalization(_:)>.

## Discussion

Set the [`isCameraAssistanceEnabled`](/documentation/NearbyInteraction/NINearbyPeerConfiguration/isCameraAssistanceEnabled) flag to `true` before calling this function. If you enable the flag and run a nearby-interaction session without calling [`setARSession(_:)`](/documentation/NearbyInteraction/NISession/setARSession(_:)), the framework creates an internal <doc://com.apple.documentation/documentation/ARKit/ARSession> instance to which the app has no access.

---

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)