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:
<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:
<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
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.
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
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.
Duration the user's gaze was fixed on the ad surface.
Closest distance the user approached a dimensional placement.
Tap / pinch events divided by impressions.