The examples given on https://docs.unity3d.com/Manual/UnityWebRequest.html works on Windows Desktop, Windows Mobile, Android and even in the iOS editor as expected. But when I publish the app to the Apple App Store it fails to connect to the internet. Unlike the other platforms, there is no noticeable delay and it seems to fail immediately when a request is attempted.
The error is:
Unknown Error
Is there any special way that I need to configure the XCode project to allow an iOS app to connect to the internet?
For what it is worth, here is the source code that makes the call:
IEnumerator SyncRequest(string data, Action<string> responseHandler)
{
Debug.Log("Requesting " + data);
UnityWebRequest www = UnityWebRequest.Get(baseurl + "/api-voteoptions.php?" + data);
yield return www.Send();
if (www.isError) // <-- Always true on published iOS app
{
string error = www.error; // <-- "Unknown Error"
Debug.LogWarning(error);
if (responseHandler != null)
{
responseHandler(error);
}
}
else
{
string response = www.downloadHandler.text;
Debug.Log(response);
if (responseHandler != null)
{
responseHandler(response);
}
}
}