Ionic (3) WKWebView IOS 14 ITP - Best options

I’m looking for options and solutions for IOS 14 ITP problem.
Seems like there are bunch of paths floating around the internet. Trying to find the best solutions that work with ios 14 building with xcode 12+.

Some history as I understand it, correct me if I’m wrong.
First WKWebView was being pushed to be used.
This enforces CORS
In my case I was able to fix this problem by adding in a path for preflight check.

Had some other problems with cookies not being stored correctly. Thought I had solved that with a plugin- but -
That only worked on ios 13, once tested on ios 14 having problems again.

What I know is that a feature in ios 14 - ITP - enforces its own cross domain layer. Because all ionic/cordova app have a different domain its blocked.

It does seem like its related to building code with Xcode 12.+ version. Have heard of people able to build an ios 14 app fine under xcode 11 something. Only seems to have problem with Xcode 12+.

Looking for solutions to fix this.

1- Looks like apple add a tag for Info.plist WKAppBoundDomains. A kind of whitelist for other domains the app needs to talk to. This seems like the ideal path but I can’t see a Cordova way to really implement this or if anybody has got this working.

2- Some plugin solution.
I have been trying to use this

with not much luck.
I can log in which is good but for some reason after 3 or 4 api calls the cookies seem to be lost.
I was trying to use this JUST for login process and hoping all other angular http request would work.
Really confused on how this solves the problem.

3- I have seen somebody say they had success adding in
<preference name="Hostname" value="" />
To config.xml but had to tweak their CORS on the server again to handle this.
Not completely clear on what is all needed. I might look into this more.

How has anybody in the community been able to build ios 14 apps in xcode 12+ and release them?
What worked for you?
Please state your ionic version and I guess which version of cordova-ios you are using. More details the better.

I’m stuck on Ionic 3.20 and cordova-ios 5.1.1 I think.

Hope to find a good solution once and for all.

After weeding through everything the best option for me was adding in hostName to config.xml.

<preference name="Hostname" value="" />

This has to be the exact domain that your requests are being sent on. Gets tricky with all our test environments.

if you server address is then the hostname needs to be
Not sure if CORS would still be an issue. I set our server to handle it.

We have another newer docker box like this – test-system-docker.user.local:8080
Uses everything before the port for the hostname.
Uninstall any other cookies or xhr plugin i had been using to fix this issue.

If you can I think this is straight forward approach.

Hi helpmelearn
What changes have you made on the server side?
I think the changes were in Web.config?
Can you explain exactly what needs to be done?
Thank you.