Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WKWebView CORS error #44

Closed
peterpeterparker opened this issue Aug 24, 2016 · 5 comments
Closed

WKWebView CORS error #44

peterpeterparker opened this issue Aug 24, 2016 · 5 comments

Comments

@peterpeterparker
Copy link

Hi,

I'm using Ionic2. To improve the performance of my app on iOS9, I want to take advantage of WKWebView to improve the overall performances.

Unfortunately, using WKWebView, I wasn't able to query the Yelp API v3.

Only ajax requests with header containing 'Access-Control-Allow-Origin: *' are allowed (or could be performed) using WKWebView.

Could you plz then enhance your API v3 and allow Cors?

Side notes:

I tried both cordova-plugin-wkwebview-engine and telerik wkwebview plugins.

In both plugin you find references to that problem:

Telerik-Verified-Plugins/WKWebView#87

ionic-team/cordova-plugin-wkwebview-engine#3

Also note that I already opened a Cors ticket problem with the Yelp API, which could be solved with the help of a local proxy. Unfortunately this solution only work for local development purpose and can't be embedded and shipped in a Ionic / Cordova mobile solution

#21

Thx in advance for your feedback

@tomelm
Copy link
Contributor

tomelm commented Aug 30, 2016

Hey @peterpeterparker! We don't have any plans to allow CORS on the API. The auth flow we've built for the v3 API isn't suited towards being integrated directly from a client, it risks exposing sensitive information from inside the app.

@peterpeterparker
Copy link
Author

Hi @tomelm, thx for your answer. I understand that point of view, but in the current state, doesn't then that mean that every single Angular client requests performed on WKWebView, Safari running on >iOS 8, not gonna be accepted aka not gonna work?

I guess these clients exists too? Or maybee I just miss something and there is a simple solution to such a problem, in that case, would be realy thanksful to hear about it.

@tomelm
Copy link
Contributor

tomelm commented Sep 1, 2016

@peterpeterparker I think the best option right now is probably going to be building a small backend for your app to handle requests to the API and forward those on.

@peterpeterparker
Copy link
Author

@tomelm well that's one of the thing I'm trying to avoid because this would means more load on my servers, which I have to avoid. It's also one of the reason why I implemented the Yelp services instead of services of other providers (like the one beginning with Four...).

But again, maybe I'm dumb and other people using the Yelp V3 Api thru Angular2 or Ionic2 within WKWebView doesn't face CORS problems, would be glad to hear how they solve it. And if I'm not that dumb, means other peoples face or gonna face the same problem using the Yelp V3 Api.

@peterpeterparker
Copy link
Author

For the record, the referenced cordova plugin issue (ionic-team/cordova-plugin-wkwebview-engine#3) is now close since the release of the version 3 of the plugin.

I tried it, I wasn't more lucky.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants