Prism ARDocsGet the SDK
PlatformsvisionOS

Platforms

visionOS

Integration guide for Apple Vision Pro. Covers setup, privacy entitlements, overlay and dimensional placements, and spatial analytics.

Requirements

  • Xcode 15 or later
  • Deployment target: visionOS 1.0+
  • Apple Vision Pro device or simulator
  • Active Apple Developer account

Privacy Entitlements

Dimensional ads and gaze analytics require additional entitlements in your .entitlements file:

MyApp.entitlements
<key>com.apple.developer.arkit.main-camera-access.allow</key>
<true/>
<!-- Only required for gaze analytics -->
<key>com.apple.developer.arkit.eye-tracking.allow</key>
<true/>

Add corresponding usage descriptions to Info.plist:

Info.plist
<key>NSCameraUsageDescription</key>
<string>Used to anchor ads to surfaces in your space.</string>
<key>NSEyeTrackingUsageDescription</key>
<string>Used to measure ad attention and improve relevance.</string>

Initialization

Swift
import PrismAR

@main
struct MyVisionApp: App {
    init() {
        PrismAR.initialize(
            appId: "YOUR_APP_ID",
            environment: .production,
            config: PrismConfig(
                enableGazeAnalytics: true,   // requires eye-tracking entitlement
                enableDimensional: true       // requires camera entitlement
            )
        )
    }

    var body: some Scene {
        WindowGroup {
            ContentView()
        }
        ImmersiveSpace(id: "AdSpace") {
            ImmersiveAdView()
        }
    }
}

Overlay Ads in Window Groups

Overlay ads attach to a WindowGroup and render as a native SwiftUI layer. They are automatically clipped to the window boundary and respect glass material compositing.

Swift
import PrismAR
import SwiftUI

struct ContentView: View {
    var body: some View {
        NavigationStack {
            AppContent()
        }
        .overlay(alignment: .bottom) {
            PrismAdView(
                placementId: "YOUR_OVERLAY_PLACEMENT_ID",
                adSize: .banner
            )
            .padding(.bottom, 20)
        }
    }
}

Dimensional Ads in Immersive Spaces

Swift — ImmersiveSpace
import PrismAR
import RealityKit
import SwiftUI

struct ImmersiveAdView: View {
    var body: some View {
        RealityView { content in
            await PrismAR.addDimensionalPlacement(
                to: content,
                placementId: "YOUR_DIMENSIONAL_PLACEMENT_ID",
                surfaceType: .wall
            )
        }
    }
}

Analytics & Reporting

visionOS analytics include approach distance, dwell time, and gaze fixation (when the eye-tracking entitlement is granted). All metrics are available in the Prism AR dashboard under Reports.

Gaze Fixation

Duration the user's gaze was fixed on the ad surface.

Approach Distance

Closest distance the user approached a dimensional placement.

Interaction Rate

Tap / pinch events divided by impressions.