2

I'm making a POST request to an external API using fetch.

On iOS 10 I don't receive any reply, no errors and I can't see any network activity related to my request in safari's web inspector.

I've the cordova-plugin-whitelist installed and <access origin="*"/> in my config.xml. I've also added an access-origin rule with the URL of the API, without success.

EDIT: seems like iOS webview doesn't have fetch, I installed a polyfill and now I get this error:

Failed to load resource: An SSL error has occurred and a secure connection to the server cannot be made.

Adding <key>NSAllowsArbitraryLoads</key> to my info.plist doesn't solves it.

Any tip or help on how to solve this? Thanks

Devid Farinelli
  • 7,514
  • 9
  • 42
  • 73
  • add follwoing meta tag in index.html with replace your service api address in above meta tag **** – Naitik Nov 04 '16 at 11:10
  • Hi, thanks for your reply. I have this at the moment `` I have probably made some progresses, seems like iOS doesn't have `fetch` – Devid Farinelli Nov 04 '16 at 11:17
  • please replace with my give one, but please change **yourdomain.com** with you service IP address – Naitik Nov 04 '16 at 11:18
  • Done, but it does no difference :( I've updated my question – Devid Farinelli Nov 04 '16 at 11:34
  • 1
    for ssl try http://stackoverflow.com/questions/39501523/cordova-whitelist-ios-10-ssl-error-failed-to-load-resource-an-ssl-error-has-oc or http://stackoverflow.com/questions/32755674/ios9-getting-error-an-ssl-error-has-occurred-and-a-secure-connection-to-the-ser or https://forums.developer.apple.com/thread/6767 – Naitik Nov 04 '16 at 11:38

1 Answers1

1

Supposing my URL is my.api.domain.com adding

<access origin="https://*.api.domain.com/" />

to my config.xml solved my issue

Devid Farinelli
  • 7,514
  • 9
  • 42
  • 73