Http Request on iOS
I am trying to perform a very simple GET request on iOS. I just want to get the response from a PHP page that I have created to access a database. The code works perfectly on Andoid, Windows and OSX but causes a crash immediately as it's called on iOS. I've been trying to figure this out for about a month now and it's killing me. I will be so incredibly happy if someone knows what is going wrong.
The code I'm using is below.
Header .h file:
If there is another way of doing this I am totally open to suggestions!!! I tried creating a fresh project and adding the code to test it out. It crashed as expected. I have "HTTP" added to my public and private dependencies in build.cs and #include "Http.h" in my header file. Once again it works on all platforms I've tested but iOS.
Here is the crash log:
Thank you so much for any help you can offer. I am truly desperate and cannot move any further on 2 of my projects without this functionality.
Oh wow I finally got it to work. Thank you so much Shadowriver for showing me NSLog! That gave me the output I needed to figure out what was actually going wrong! I needed to allow an exception for the connection I'm making in the plist.
I just added this to the "additional plist data" section in project settings->ios (this is for google.ca for example):
I removed the line breaks from above. You are amazing Shadowriver!
Edit: I am converting this to answer and marking it for future people having this problem.
Well you would need to build debug version of engine, which means you need to build it from source. But try to get log first, since for me looking on what i can read from this crash now it is controlled crash.
i don't know how to get the logs in iOS, i don't know how devlopment looks there, but i my guess is you can watch logs in some of iOS debug tools in XCode. In case of Android UE4 it prints logs in to central system log called logcat, which you can see using ADB or Android monitor tool, so the same probably is with iOS, there might be tool for that. I trying to google but i can't find much, this might direct you somewhere:
UE4 definitly uses NSLog to print anything: https://github.com/EpicGames/UnrealEngine/blob/97c8d3ef55e869e17ef149903eae2a33101381c9/Engine/Source/Runtime/Core/Private/IOS/IOSPlatformMisc.cpp#L138
answered Jan 27 '16 at 06:46 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here