Send PDF file from DocumentsDirectory to iBooks

817 views Asked by At

I'm trying to send a downloaded pdf file from DocumentsDirectory to iBooks, and save it there. The code I used is:

    let url = URL(string: "itms-books://device_path_to_pdf_file/index.pdf")
    if UIApplication.shared.canOpenURL(url) {
      UIApplication.shared.openURL(url)
    } else {
      print("iBooks not installed")
    }

On runtime, this code opens iBooks on device but doesn't show the pdf file there. I'm running this code on Xcode 8.3-Beta and iOs 10.3 on device.

Any idea? Thank you.

0

There are 0 answers