Search code examples
androidunity-game-enginehref

OpenURL works in editor and runtime but does not work after building onto Android


So I am trying to make a button that opens up to a webpage when clicked. Here is the code for the function:

public void ToHyperLink()
    {
        string theURL = parentButton.GetComponent<BLButton>().btnRefObj.GetComponent<HyperlinkAttri>().prodURL;
        Application.OpenURL(theURL);
    }

The URL is passed through the inspector like this: enter image description here

This works perfectly fine when testing it on my PC, but once it is built to my Android phone it stops working.


Solution

  • Just tested it. Application.OpenURL("http://google.com"); works fine.Give the link directly and check if it is coming.You can install Android Logcat from package manager and connect android phone via usb and click build and run and check for any errors.