Devid Farinelli Devid Farinelli - 23 days ago 8
iOS Question

Ionic 1 app XHR request working on Browser/Android failing on iOS

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

Answer

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

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

to my config.xml solved my issue

Comments