Detect Headset Mount/Unmount


Is there a way to detect that the headset has been unmounted/mounted ?

Unfortunately, no. There is no direct signal from the OS to the application that the user is wearing the headset. The regular app lifecycle callbacks will fire (applicationDidResignActive, etc.) but can’t be distinguished from other actions like dismissing the app with the crown button or otherwise returning to the home screen.

Please submit feedback to Apple (using their Feedback Assistant) to request this feature.

Thanks for your quick answer, understood for the mounted/unmounted event. Do we have access to these actions (dismissing the app) in Unity? Or we have to do a swift plugin?

Thanks again !

You should be able to use the OnApplicationFocus, etc. MonoBehaviour events. With that said, you may find that they don’t behave as expected, both because of how the platform differs from, say iOS (multiple windows/volumes can come from the same app), and because we still have some kinks to work out in our implementation. So you may also want to play around with how our UISceneDelegate and UIApplicationDelegate are implemented. They make calls into UnityLibrary which eventually result in those MonoBehaviour events. Things will work a little differently for MR builds vs. VR builds, and you may also want to look at the OnWindowFocused event for VolumeCamera which can tell you when the volume itself is focused.