I'm using unity and I've got some simple code that should work but doesn't for some reason and I'm stuck. Basically I am just trying to open up a website through a button click "On Click ()" in an application meant for android but it does not work. The code goes as follows.
public string url;
public void Website()
{
Application.OpenURL(url);
}
public void Website2(string diffURL)
{
Application.OpenURL(diffURL);
}
public void Website3()
{
Application.OpenURL("http://www.google.com/");
}
As you can see I have three different variations of the same "Application.OpenURL" testing on three different buttons and all three do not work. Some more information:
- I have paid close attention to format the websites properly with quotation marks and "http://"
- I have already set the "Internet Access" to "require" in the player settings,
- and interestingly enough, they work in the game window when testing, it is only when I upload the apk to my android device that it does not work anymore .
The buttons register I am pressing them as evident by the slight darkening of the button press when I press on my android device but nothing happens. I have seen this question asked around but no solution to my issue has been found. Are any other build settings wrong? Any other thing I should change in Unity? API level or what?(currently 19 on min and highest installed on target)
Is there some settings I should change on my android device to allow this to happen? Because as stated earlier it works when testing through the game window on unity but not on android.
(The function "Website3()" begun to work when I rebuilt the app. No changes were made. "Website1()" and "Website2()" however still do not work on android and they work perfectly fine on unity game window.)