Hi! I have problem with webrequests on iOS. Xcode gives me a following error:
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.
Here is the code i’m using for connecting to the http server
public IEnumerator WaitForRequest(String query)
{
string URL = "http://server.com/backend?message=" + query;
UnityWebRequest www = UnityWebRequest.Get(URL);
yield return www.Send ();
if (!www.isError)
{
yield return www.downloadHandler.text;
}
else {
yield return "fail";
}
}
In the info.plist i have following lines added
<key>NSAppTransportSecurity</key>
<dict>
<!--To support localhost -->
<key>NSAllowsLocalNetworking</key>
<true/>
<!--To continue to work for iOS 9 -->
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
I have tried various fixes i’ve found while searching for answers to this problem, but nothing seems to work.
I’m using Xcode version 8.2.1 and Unity version 5.5.1f1