I have a simple method that is attempting to connect to the internet.
It works in the Unity editor and in a standalone build, however it doesn’t on Android.
public static IEnumerator Login(string username, string password, Action complete)
{
WWW reader;
do
{
string url = string.Format(UrlStart + "Login.php?user={0}&pass={1}", username, password);
reader = new WWW(url);
yield return reader;
}
while (reader.error != null);
Logger.Log(LogTopic.Framework, "Logged in as " + username);
complete();
}
As you can see there’s not a lot to it, yet for some reason it doesn’t work.
I made sure internet is a requirement in the player settings, my phone’s internet is turned on. I even manually typed in the URL on my phone (in the browser), and I got the results I expected.
What would cause this?