You Are Using Download Over Http. Currently Unity Adds Nsallowsarbitraryloads to Info.Plist to Simplify Transition

You are using download over http. Currently Unity adds NSAllowsArbitraryLoads to Info.plist to simplify transition

Apple stopped allowing http connections on iOS devices. You can still use http connection by adding NSAppTransportSecurity to the info.plist but this will be removed in the future.It is recommended that you use https connection from now.

  • http://yourdomain.com will give you this error.
  • https://yourdomain.com will NOT give you this error and is what Apple
    recommends now.

UnityWebRequest was introduced to automatically solve this problem by adding NSAppTransportSecurity to the info.plist.

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;
}
}

Note that your app may be rejected if you add NSAppTransportSecurity to the info.plist without good explanation to Apple. Again, it is recommended that you upgrade your server and use https instead of http.

unity ios using https unable to make rest callout

I got it figured out. The issue was the url contained a % sign and ios apparently cant handle that.



Related Topics



Leave a reply



Submit