Added some ionic/cordova functionality to the app. Did a build to android and works fine.
On apple, it builds fine, and it pushes the app to the phone. I can’t login.
Open up Safari to debug and in the console log it says.
Failed to load resource: Origin http://localhost:8080 is not allowed by Access-Control-Allow-Origin. then the dev service I had the code point to.
Is ios trying to run this as a server and not as a file?
Not sure why I didn’t have this problem on android.
Any idea how to fix?
So from the sounds of this, you might be hitting a WKWebview issue.
WKWebview enforces CORS and does not provide a way to bypass it. Meaning that what ever API you’re making a request to needs to implement CORs correctly. The WKWebview docs go over this in more detail and link to some MDN resources
I guess I’m just dumb to all of this, but the fix is to add
"Origin: http://localhost:8080"
I’m not sure where I’m adding that. Am I adding that to my server (jboss), to the web service requests, or to something I’m sending out?