Skip to content
This repository was archived by the owner on Jun 15, 2024. It is now read-only.

Commit 7128178

Browse files
committed
fix(iOS): fix loading local PDF files on iOS
1 parent b591bd9 commit 7128178

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/plugin.ios.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,14 @@ export class PDFView extends common.PDFView {
2020
}
2121

2222
public load(src: string) {
23-
const url = NSURL.URLWithString(src);
23+
let url: NSURL;
24+
25+
if (src.indexOf('://') === -1) {
26+
url = NSURL.fileURLWithPath(src);
27+
} else {
28+
url = NSURL.URLWithString(src);
29+
}
30+
2431
const urlRequest = new NSURLRequest(url);
2532
this.ios.loadRequest(urlRequest);
2633
}

0 commit comments

Comments
 (0)