Unable to open MS Word and PDF docs with SFSafariViewController in latest iOS 13.0

We are trying to use SFSafariViewController to browse a Word document from our iOS Mobile app using Swift as it gives ReaderView and Font Increase/Decrease within the App. Everything works as expected on the Simulator with 12.2 ios version, however when we published the changes to TestFlight and started using the app on a real phone ios 13.0 version the SFSafariViewController shows the FileName and says “Open in ‘Dropbox’ 'More… '”

we want to disable/remove that option to choose different apps to open the word/pdf docs and display the content directly within the app. Would greatly appreciate if someone can help remove this option and directly display the documents like below.

Below is the code. Can someone please help how to resolve this issue?

func openGuidelineSafari(passedURL: String) {  

        let allowedCharacterSet = CharacterSet(charactersIn: " ").inverted  
        let escapedString = passedURL.addingPercentEncoding(withAllowedCharacters: allowedCharacterSet)  
        let url = URL (string: (escapedString!))  

        let config = SFSafariViewController.Configuration()  
        config.entersReaderIfAvailable = true  

        let vc = SFSafariViewController(url:url!, configuration: config)  
        vc.delegate = self  
        present(vc, animated: true)  
    }

Hi @kkadapa, if you are unable to use SFSafariViewController I would kindly suggest trying WKWebView to open the documents.

Best,
Gina

This topic was automatically closed after 166 days. New replies are no longer allowed.