Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

WWW can't work on the IOS, webplayer

Discussion in 'iOS and tvOS' started by rrtt_2323, Mar 21, 2013.

  1. rrtt_2323

    rrtt_2323

    Joined:
    Mar 21, 2013
    Posts:
    19
    Hi,

    Following code can work on PC, but it can not work on my ios, webplayer.
    unity3d version is 4.0 f7.
    Who can tell me why? :confused:

    thanks in advance

    Code (csharp):
    1.  
    2. string web_erro = "abc";
    3.  
    4. void OnGUI () {
    5.         if(GUI.Button(new Rect(100, 100, 100, 30), "get")) {
    6.             url = "www.google.com";
    7.             StartCoroutine(this.read_web(url));
    8.         }
    9.         GUI.Label(new Rect(100, 200, 200, 200), web_erro);
    10.     }
    11.    
    12.     IEnumerator read_web(string url) {
    13.         WWW data = new WWW(url);
    14.         yield return data;
    15.         if(data.isDone) {
    16.             web_erro = data.text;
    17.         }
    18.         else {
    19.             web_erro = data.error;
    20.         }
    21.     }
    22.  
     
    Last edited: Mar 21, 2013
  2. Agent_007

    Agent_007

    Joined:
    Dec 18, 2011
    Posts:
    899
    Last edited: Mar 21, 2013
  3. rrtt_2323

    rrtt_2323

    Joined:
    Mar 21, 2013
    Posts:
    19
    Thank you very much! The problem was lack of crossdomain.xml file.