Reputation: 77
I have an ionic 2 mobile app. I need to be able to whitelist my domain on the API server to allow for CORS. If I have a website I can whitelist my domain name to allow for CORS but how do I set the domain name on an app? Is it possible or is there something else I will need to do? Thanks for the help.
A
Upvotes: 2
Views: 556
Reputation: 790
The current version of Ionic uses WKWebView. WKWebView does enforce CORS. You should add this entry to the API: Origin: http://localhost:8080
.
See for more info this blog post: https://blog.ionicframework.com/wkwebview-for-all-a-new-webview-for-ionic/
And also the documentation: https://ionicframework.com/docs/wkwebview/
Upvotes: 0