Hi I am building an application for iOS using Unity3D. I am using UnityWebRequest to fetch data from my server (POST request). It works in my Unity Editor but not on my iPhone. However, I can actually see the JSON data I want in the debugging window in XCode, which is below,
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.
Unhandled Exception: System.NotSupportedException:
/Users/builduser/buildslave/unity/build/Tools/il2cpp/il2cpp/libil2cpp/icalls/mscorlib/System.Reflection.Emit/DynamicMethod.cpp(26) : Unsupported internal call for IL2CPP:DynamicMethod::destroy_dynamic_method - System.Reflection.Emit is not supported.
at System.Reflection.Emit.DynamicMethod.Finalize () [0x00000] in <filename unknown>:0
UnityEngine.UnhandledExceptionHandler:PrintException(String, Exception)
UnityEngine.UnhandledExceptionHandler:HandleUnhandledException(Object, UnhandledExceptionEventArgs)
(Filename:/Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
(MY JSON DATA)
So my JSON data display correctly in the debugger info, but why I cannot get it from my code? Like string data = MY_JSON_DATA and let me to parse?
I have checked ATS and this answer but it seems not work. Am I on the correct direction?
UPDATE: My Unity is 5.3.4p6, XCode: 7.3.1, iOS: 9.3
UPDATE2: JSON API: Newtonsoft.JSON, WebRequest: UnityWebRequest