WKWebView support
Has anybody managed to make this plugin work with wkwebview with local server?
Any updates for WKWebView? it will give me error "Not allowed to load local resource"
@jd0048 Nope. I don't recommend you using it, it is out-dated at the moment.
Hello guys! I'm using this lib for an Ionic app and it works fine on android. Today I started with iOS and I'm using cordova-plugin-ionic-webview. I fixed and I want to share with you.
You need to ionic-cache-src.js and search for:
case 'iOS':
return $window.cordova.file.documentsDirectory;
change $window.cordova.file.documentsDirectory; to $window.cordova.file.documentsDirectory.substring(7);.
It should work. It's a simple hack but it works if you need something fast.
Why this works?
When accessing files using WKWebView, you can not use "file://". That's why I'm using substring(7) there(to cut off that part).
You can get a ref from here: https://ionicframework.com/docs/wkwebview/#rewriting-file
Hope this helps!
@devfelipereis thanks a lot, you help me so much.
An improved way to perform your fix is to change to this:
window.Ionic.WebView.convertFileSrc($window.cordova.file.documentsDirectory);