iOS 13 WKWebView open PDF issue

after upgraded to iOS13 my coding to open PDF in WKWebView is not worked any more. Does anyone has the same issue?


func webView(_ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration, for navigationAction: WKNavigationAction, windowFeatures: WKWindowFeatures) -> WKWebView? {

let screenSize: CGRect = UIScreen.main.bounds

popupWebView = WKWebView(frame: CGRect(x: 0, y: 44, width: screenSize.width, height: screenSize.height - 44), configuration: configuration)

popupWebView!.autoresizingMask = [.flexibleWidth, .flexibleHeight]

popupWebView!.navigationDelegate = self

popupWebView!.uiDelegate = self

view.addSubview(popupWebView!)

self.setNavigationBar()

return popupWebView!

}

Is this PDF stored locally on the device? Or coming it from the network?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

It is coming from network, click a link to download and view in wkwebview.

Can you post a link to a PDF that shows the problem?

Note This will likely require moderator approval, but I can take care of that.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

HI..


Sorry it is an internal link to download a PDF and it cannot access outside company network.


When I click the link in safari, new browser window/tab will be opened with the intention of displaying the downloaded content in that tab.


in the iOS app WKwebview is to pickup the new browser and display the PDF, however after upgraded IOS 13 it is just showing the blank page...

Sorry it is an internal link to download a PDF and it cannot access outside company network.

Fair enough. My recommendation here is that you open a DTS tech support incident so that one of my colleagues can help you in private.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Hi Duncan,


We've been having some problems with this recently as well.


We tracked it down to websites sometimes sending the wrong Content-Type for PDFs, e.g. "application/octet-stream". This used to work on iOS 12 but seems to have stopped working at some point with iOS 13. I am tryng to determine a work around but haven't got there yet.


Am interested to know if this matches what you're seeing and if you managed to work around it?


Thanks,

Chris

iOS 13 WKWebView open PDF issue
 
 
Q