Skip to content

Commit

Permalink
Merge branch 'master' of github.com:zyra/ionic-image-loader
Browse files Browse the repository at this point in the history
  • Loading branch information
ihadeed committed Sep 17, 2018
2 parents 5b4bbda + da035a8 commit 940812a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/providers/image-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ interface QueueItem {
reject: Function;
}

declare const Ionic: any;

@Injectable()
export class ImageLoader {
/**
Expand Down Expand Up @@ -517,7 +519,13 @@ export class ImageLoader {
// therefore the file needs to be copied into that directory first!
if (this.isIonicWKWebView) {
// Use Ionic normalizeUrl to generate the right URL for Ionic WKWebView
resolve(normalizeURL(fileEntry.nativeURL));
if(typeof Ionic.normalizeURL === 'function' ) {
resolve(Ionic.normalizeURL(fileEntry.nativeURL));
} else if (Ionic.WebView && typeof Ionic.WebView.convertFileSrc === 'function') {
resolve(Ionic.WebView.convertFileSrc(fileEntry.nativeURL));
} else {
resolve(normalizeURL(fileEntry.nativeURL));
}
} else if (this.isWKWebView) {
// check if file already exists in temp directory
this.file
Expand Down

0 comments on commit 940812a

Please sign in to comment.