Vision OS - How to detect when digital crown is PRESSED in an immersive space?

Have a bug I'm trying to resolve on an app review through the store.

The basic flow is this:

  1. User presses a button and enters a fully immersive space
  2. While in the the fully immersive space, user presses the digital crown button to exit fully immersive mode and return to shared space (Note: this is not rotating the digital crown to control immersion level)
  3. At this point I need an event or onchange (or similar) to know when a user is in immersive mode so I can reset a flag I've been manually setting to track whether or not the user is currently viewing an immersive space.

I have an onchange watching the scenePhase changes and printing to console the old/new values however this is never triggered.

Seems like it might be an edge case but curious if there's another way to detect whether or not a user is in an immersive scene.

Answered by fivepackguy in 789791022

The immersive environment example here: https://developer.apple.com/documentation/realitykit/construct-an-immersive-environment-for-visionos

uses onDisappear on the RealityView to detect when it is closed.

Accepted Answer

The immersive environment example here: https://developer.apple.com/documentation/realitykit/construct-an-immersive-environment-for-visionos

uses onDisappear on the RealityView to detect when it is closed.

Vision OS - How to detect when digital crown is PRESSED in an immersive space?
 
 
Q