Http requests fail on iOS device with WKWebView plugin


#1

I am having an issue making http GET requests when I deploy to my ios device. I have enabled CORS on my endpoint in API Gateway, and my GET requests are successful on android devices. The requests are also successful when emulating iOS or android with the implementation of a proxy (link I followed for the proxy is below).

http://blog.ionicframework.com/handling-cors-issues-in-ionic/

I have attempted updating the info.plist file to allow for NSAllowsArbitraryLoads with no success. I also attempted to rollback from WKWebView to UIWebView. This change resolves the API issue, but the app perfomance is compromised significantly and critical functionality is lost (specifically interacting with buttons and swiping the cards that are loaded after a successful call).

Is there a working solution for iOS devices that allows for the use of the WKWebView plugin without compromising the API calls?


HTTP post request doesn't work on my Device
#2

Same problem hereā€¦


#3

After quite a bit of investigating I found a solution, and hopefully this helps out anyone else with a similar issue. It turns out that in order to make calls to a server with the WKWebView plugin, you need to use the ionic native http plugin (this is only necessary if you are deploying to iOS devices, otherwise you can simply use the angular http plugin). The link I followed for implementing it is below.

NOTE: if you want to utilize a proxy for emulating or running from localhost you must use the angular http plugin. The forum I gathered this knowledge from is listed below.

As a result, whenever I want to test my app using the emulator I use the angular http plugin with a proxy, and whenever I deploy to a device I utilize the ionic native http plugin (no proxy).