Search Unity

How to open a URL in Gear VR App

Discussion in 'AR/VR (XR) Discussion' started by infinite360VR, Sep 28, 2016.

  1. infinite360VR

    infinite360VR

    Joined:
    Apr 19, 2016
    Posts:
    23
    Hi,

    I would like to know how to open URL on button click in Gear VR App. I know there is Samsung Internet App in Oculus Store that can be used in this scenario. Just like in 2D Non-VR Android Application URL is automatically opened in Chrome or Firefox based on default browser. But in Gear VR app when I call
    Code (CSharp):
    1. Application.OpenURL("http://www.google.co.uk");
    the app freezes.

    If this is not possible at all, then is there a way to show webView in 3D space?

    Any kind of help will be appreciated.
     
    Last edited: Sep 28, 2016
    itsharshdeep and glitchers like this.
  2. glitchers

    glitchers

    Joined:
    Apr 29, 2014
    Posts:
    64
    Hi @infinite360VR

    I was having the same issue and after coming across this post on the Oculus forums I have created a solution that is working for me currently (Unity 5.6.0f3, Samsung S7 running Android 7) but not using a 3D webview. For me this is enough.

    The code is here - https://gist.github.com/glitchersgames/557bc2dce118221b5e3734c2e900fac9

    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.

    You could show a message to the user telling them to remove the headset + device to see the website.
     
  3. UmairEm

    UmairEm

    Joined:
    Nov 7, 2015
    Posts:
    31
    Hello @glitchers

    Thank you very much for sharing this. I have posted this to my question on StackOverflow as well.