问题
I'm working on an app with Ionic 1 and AngularJS 1.5
I was told that I need to upgrade my ios to use WKWebView instead of UIWebView: https://ionicframework.com/blog/understanding-itms-90809-uiwebview-api-deprecation/?utm_campaign=enterprise&utm_source=hs_email&utm_medium=email&utm_content=85128961&_hsenc=p2ANqtz--vsf3kcg7MssMWwjv2_GpHmVbzN23_5fXDfKT0E6OileYraLWs9btGPqWUcq5mzTKCtKwXGqO35V3SnInjypj4uqSBRg&_hsmi=85128961
Here is my setup:
cordova-android 8.1.0
cordova-ios 5.1.0
cordova-plugin-ionic-webview 4.1.3
cordova 8.1.2
ionic 5.4.16
node 10.19.0
iOS 13 iPhone 11 Pro Max
Error:
unsafe:ionic://localhost/img/white/activities.svg
An error occurred while trying to load the resource
I have tried the suggestion here with the sanitize but it doesn't seem to work for me: https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/284
How can I get my images to show?
回答1:
Actually, there was a problem with my code and yes, the suggestion here does work: https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/284
$compileProvider.imgSrcSanitizationWhitelist(/^\s*(https?|ftp|file|blob|ionic):|data:image\//);
Now all my images show.
来源:https://stackoverflow.com/questions/60934961/cordova-ios-wkwebview-upgrade-errors-when-showing-some-images