I am working on an application for my web service. I work with LitJson
, I finished the application but at the moment of exporting it to test it in my android does not work related to WWW IEnumerator
s.
For example, a button that starts the session, only the function that calls the IEnumerator
works, but the IEnumerator
itself does not work, and I have checked it by placing an alert message that it creates for the application.
This is the function that the button calls:
public void LogIn() {
UserName = GameObject.Find("inputUsuario").transform.GetChild(2).gameObject.GetComponent < Text > ().text;
Password = GameObject.Find("inputPassword").transform.GetChild(2).gameObject.GetComponent < Text > ().text;
Debug.Log("Username:" + UserName + "And Password:" + Password);
StartCoroutine(LogInWWW());
}
And this is the IEnumerator
:
public IEnumerator LogInWWW() {
WWW www = new WWW(UrlLogin + "?userName=" + UserName + "&password=" + Password);
yield return www;
print(www.text);
if (www.error == null) {
ProcessjsonLogin(www.text);
} else {
Debug.Log("ERROR: " + www.error);
}
}
I must add that there is no error in the debug console on Android. Also I must clarify that to the URL I have added the prefix "http://" since it is a solution that give in the questions that I have seen.