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
String List in SQLcommand Through Parameters in C#
Dotnet.Highcharts: Cost Not Plotted Against the Correct Date
What Is The Story of Performance Counters for .Net Core
Retrieve an Object from Entityframework Without One Field
How to Return Dynamic Object from SQL Query
"Can't Find Pinvoke Dll 'Dbnetlib.Dll'." Error in Smart Device Application
Getters and Setters Are Bad Oo Design
Signalr Owin Self-Host on Linux/Mono Socketexception When Clients Lose Connection
Preventing SQL Injection on ASP.NET Web Application
Benefits of Use Parameters Instead of Concatenation
C# Null Coalescing Operator Equivalent for C++
How to Configure ASP.NET Kestrel for Low Latency
Is Idependencyresolver an Anti-Pattern
Entity Framework the Underlying Provider Failed on Open
Getting Networkcredential for Current User (C#)
Dependency Injection with a Static Logger, Static Helper Class