File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ interface QueueItem {
1818 reject : Function ;
1919}
2020
21+ declare const Ionic : any ;
22+
2123@Injectable ( )
2224export class ImageLoader {
2325 /**
@@ -517,7 +519,13 @@ export class ImageLoader {
517519 // therefore the file needs to be copied into that directory first!
518520 if ( this . isIonicWKWebView ) {
519521 // Use Ionic normalizeUrl to generate the right URL for Ionic WKWebView
520- resolve ( normalizeURL ( fileEntry . nativeURL ) ) ;
522+ if ( typeof Ionic . normalizeURL === 'function' ) {
523+ resolve ( Ionic . normalizeURL ( fileEntry . nativeURL ) ) ;
524+ } else if ( Ionic . WebView && typeof Ionic . WebView . convertFileSrc === 'function' ) {
525+ resolve ( Ionic . WebView . convertFileSrc ( fileEntry . nativeURL ) ) ;
526+ } else {
527+ resolve ( normalizeURL ( fileEntry . nativeURL ) ) ;
528+ }
521529 } else if ( this . isWKWebView ) {
522530 // check if file already exists in temp directory
523531 this . file
You can’t perform that action at this time.
0 commit comments