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

Issue

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.

Answered By – zyonneo

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published