I need to open a document (it can be pdf, doc, html or other format) at some URL in my iOS app. What is most difficult is that access to the URL has to be authenticated, so I can't just open it in Safari. Also I must not store unencrypted files locally, because of possible unauthorised access on jailbroken device (it is customer requirement). Consequently I also can't share files using UIDocumentInteractionController or open them with QLPreviewController. Are there other options?
Asked
Active
Viewed 97 times
0
-
Add a cookie to your URL request that would load the secure page on the web? – Brandon Stillitano Apr 16 '21 at 08:04
-
If you mean SFSafariViewController or system browser in this case I only can open an URL and can't pass cookies to Safari. As to WKWebView it can't open most of document formats. – Vladimir Apr 17 '21 at 01:14
-
What formats are you trying to open? WKWebView supports most modern document formats. – Brandon Stillitano Apr 17 '21 at 01:20
-
1@Brandon, yes, I've checked it. WKWebView supports preview at least for common images, MS documents, iWork, mp3 and mp4, csv, rtf and some other formats. I'm not sure if it fits my needs, but it is an option, could you add it as an answer? – Vladimir Apr 18 '21 at 14:47
1 Answers
1
You can present a WKWebView and allows you to pass through cookies so that you don’t have to authenticate every time you open it

Brandon Stillitano
- 1,304
- 8
- 27