I am using Cordova to build an iOS App. I use the Ionic engine meaning that the app is served from a webserver running on the device.
My window.location.origin
is "ionic://my-app.com".
A third party API (that I need to use in order to fetch an address suggestion based on what the user types) rejects my HTTP requests because the referrer
header is missing in the request.
It's not possible to programmatically add a referrer from the JS layer and these did not work:
<meta name="referrer" content="origin">
<meta name="referrer" content="always">
I suspect that the issue is that the API is using https
and my iOS App is using a custom scheme (the default one is ionic://
and cannot be changed to https). For this reason the referrer header is not added by the WebView.
How can I solve this issue?