2016-09-02 4 views
1

でダウンロードして、iOSとAndroid with Unityの両方のアプリを作成します。 I connect to an https address
- - I did set the Allow Arbitrary Loads to YESUnity iOS、https

しかし、それは働いていない
:私は今のiOS問題にこだわって

You are using download over http. Currently unity adds `NSAllowsArbitraryLoads` to `Info.plist` to simplify transition, but it will be removed soon. Please consider updating to https. 

サポートされていないURL

実際の問題があります。

string GET = "mail="+mail+"&nome="+nome+"&cognome="+cognome; 
// get parameters 
WWW response = new WWW (SERVER+"adduser/?"+GET); 
// calling page, address is like 'https://website.com/' 
while (!response.isDone && response.error != "") { 
    yield return null; 
} 
if (response.error != "") { 
    print (response.error); 
    return false; 
} 

明らかに、これはIEnumerator機能であり、それは常に前のエラーを返します。

は、ここに私のコードです。

答えて

2

AppleはiOSデバイスでhttp接続を許可しなくなりました。 info.plistNSAppTransportSecurityを追加してもhttp接続を使用できますが、これは今後削除されます。今からhttps接続を使用することをお勧めします。この問題を解決するためにUnityWebRequestが導入されました。

IEnumerator makeRequest() 
{ 
    string GET = "mail=" + mail + "&nome=" + nome + "&cognome=" + cognome; 
    UnityWebRequest www = UnityWebRequest.Get(SERVER + "adduser/?" + GET); 
    yield return www.Send(); 

    if (www.isError) 
    { 
     Debug.Log("Error while downloading: " + www.error); 
    } 
    else 
    { 
     // Show results as text 
     Debug.Log(www.downloadHandler.text); 

     // Or retrieve results as binary data 
     byte[] results = www.downloadHandler.data; 
    } 
} 
+2

ありがとうございます! SMHそれは状況を解決! – ZioCain

+0

@ZioCainなぜこの問題を解決したので回答を受け入れなかったのですか?これで問題が解決したら、それを答えとして受け入れるべきです。それは感謝の気持ちでいっぱいです。なぜそれをしたのか説明すればいいでしょう。 – Programmer

+1

申し訳ありませんが、私は答えを受け入れたと思ったのですが、なぜ私が受け入れられなかったのか分かりません。私は実際にSOの仕組みを理解しようとしています。 – ZioCain

関連する問題