I had found the solution from this post on 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
}
It will wait until the user has removed the headset before opening the
app to avoid the jarring visuals of the app freezing when you try to
open the URL. If the player takes the headset off and puts it back on
they will be returned to where they were in the game.
Hope this helps late users :)
Courtesy: Glitchers Games