enter code here
hey there
I wanted to get a xml file from a webserver. It worked perfect for android and pc, but I can’t get the connection on ios. I think ios got problems with the www class, but I also think its possible and I’ve got a mistake in the coroutine. Please have a look at my code, maybe youre able to help me:
Debug.Log("ERROR: " + www.error) shows me "ERROR: ".
crossdomin.xml is on the server
void Start(){
StartCoroutine(StartLoading());
}
IEnumerator StartLoading(){
string url = "http://www.pixcube.com/games_ad/AppData.xml";
WWW www = new WWW(url);
while(!www.isDone)
yield return null;
if (www.error == null){
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(www.data);
ProcessAppLinks(xmlDoc.SelectNodes("AppLinks/AppLink"));
}else{
Debug.Log("ERROR: " + www.error);
}
}
private void ProcessAppLinks(XmlNodeList nodes){
foreach (XmlNode node in nodes){
//get all infos out of the xml node
StartCoroutine(DownloadImage(nodeWithImageWebLink));
}
}
IEnumerator DownloadImage(string url){
WWW www = new WWW(url);
while(!www.isDone)
yield return null;
imageArray.Add(www.texture);
}