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 compatibility #23

Open
iwan-uschka opened this issue Oct 26, 2020 · 0 comments
Open

WKWebView compatibility #23

iwan-uschka opened this issue Oct 26, 2020 · 0 comments

Comments

@iwan-uschka
Copy link

iwan-uschka commented Oct 26, 2020

Hi there,

(question at the very end)

due to Apple's deprecation of UIWebView we need to switch to WKWebView. We could solve cookie issues using cordova-plugin-wkwebview-file-xhr for making AJAX requests. But we are not able to load HTML assets (image for instance via <img src="..." >) which are accessible with a valid session cookie only.
So now i was thinking to make API calls using cordova-plugin-fetch instead of using cordova-plugin-wkwebview-file-xhr and being able to receive cookies via

cordovaFetch('/users.json')
.then(function(response) {
  console.log(res.headers['Set-Cookie']);
})

and inject this cookie into the WKWebView by using cordova-plugin-wkwebview-inject-cookie like

cookiesArray = [{
  domain: 'abc.xyz',
  name: 'cookie name',
  path: '/',
  value: 'cookie string'
},{...}]

wkWebView.injectCookie(cookiesArray);

It would require quite a bit of refactoring to be able to test this scenario. That's why i want to ask beforehand if this plugin works with WKWebView flawlessly.

Thx.

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

No branches or pull requests

1 participant