I found a solution from this post on the Oculus forum.
Here is the working code:
public class OpenWebsiteOnHeadsetRemove : MonoBehaviour { #region Serialized public OVRManager m_OVRManager; #endregion #region Variables private bool m_UserPresent = true; private bool m_HasOpenedURL = false; #endregion #region Lifecycle private void Update () { #if UNITY_ANDROID bool isUserPresent = m_OVRManager.isUserPresent; if( m_UserPresent != isUserPresent ) { if( isUserPresent == false && m_HasOpenedURL == false && Application.isEditor == false ) { m_HasOpenedURL = true; Application.OpenURL("http://www.google.co.uk"); } } m_UserPresent = isUserPresent; #endif } #endregion }
Wait for the user to remove the headset before opening the application to avoid the harsh visual effects of the application when you try to open the URL. If the player turned off the headset and turned it on again they will be returned to where they were in the game.
Hope this helps later users :)
Courtesy: Glitter Games
source share