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?
0
votes
Add a cookie to your URL request that would load the secure page on the web?
– Brandon Stillitano
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
What formats are you trying to open? WKWebView supports most modern document formats.
– Brandon Stillitano
@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