[SOLVED] IonicView App - Http request to external API

Hi guys,

Same problem here. I’m trying to fetch the source of an external URL:

I’m using $http.get(URL)

and the console with: ionic emulare ios -lc give me this:

0 372693 error “Cannot GET /hipertextual.com/2016/07/iron-man-mujer?paras=2\n”

in Android is working perfectly, this is my plugin list:

com.napolitano.cordova.plugin.intent 0.1.3 "IntentPlugin"
com.oauthio.plugins.oauthio 0.2.4 "OAuth.io"
cordova-plugin-compat 1.0.0 "Compat"
cordova-plugin-customurlscheme 4.2.0 "Custom URL scheme"
cordova-plugin-file 4.2.0 "File"
cordova-plugin-file-transfer 1.5.1 "File Transfer"
cordova-plugin-http 1.1.0 "SSL Pinning"
cordova-plugin-inappbrowser 1.4.0 "InAppBrowser"
cordova-plugin-splashscreen 3.2.2 "Splashscreen"
cordova-plugin-whitelist 1.2.2 "Whitelist"
sk.kcorp.cordova.ios-security 0.3.0 “IOS Security”

My issue ended up being that my SSL certificate on my API server was missing the intermediate certificate. Try using this: SSL Checker Android seems to be much more strict in what it will accept from SSL configuration.

In my case I just need to add the intermediate certificate. I downloaded it from the provider, included it with the certificate keys and was good to go.

Hope that helps.

I solved with a workaround

Hello there, I happen to have the same probelm. When I am testing my app with ionic serve or http-server on a browser on my pc or on my android or ipad device the data from the external api im getting via http request are show. But when i use ionic run android to run the app on my device, the data from the http request are nowhere to be seen. I have checked many forums about this problem, i tried adding code lines to my manifest file, to my config file, to my index file, i also removed and readded cordova whitleistplugin as recommended on many forums. But the issue still occurs.
Could you please help me solve this issue? I can clone my project, just tell me what to do in order to get help .

Hello alacret,
what is your workaround?
Thx for your help

Thank you, I have been trying to solve this issue for over an hour

Thanks cityzen! The SSL checker discovered the issue and adding the full chain was helpful. Adding in certs by Let’s Encrypt resolved the issue for me!

Thanks a lot Tim! You saved my day.

Thanks Tim! The following instruction were very helpful to make Http request work with external API:

  1. Upload the application with the URL of the server again to IonicView App (Just in case);
  2. Open the IonicView App and clean the app data;
  3. Restart IonicView app (double tap on home button and closing process).

In my project im uploading image with contents of iFrame. Image is successfully uploading in some devices.(Moto e, samsung J5). But while testing in a REDMI phone, it gives the error “Failed to load resource: net::ERR_ACCESS_DENIED”. Image upload is failing. This looks very confusing. Also receiving this error in some other devices