0

Is it possible to share a PDF to the Apple Books app via an Ionic application?

I am sending a message from an iframe inside my Ionic app up to the parent window. This message contains the PDF blob and filename. In Ionic I am checking if the platform is iOS, then checking if the user has Apple Books installed via the AppAvailability plugin. If Apple Books is installed I want to save my PDF file there, otherwise I will show some alert asking the user to install Apple Books.

So, how can I share a PDF to Apple Books via an Ionic application?

if (this.platform.is('ios)) {
    this.appAvailability.check('ibooks://').then(
        (yes:boolean) => {
            // save to Apple Books
        },
        (no:boolean) => // alert user
    );
} else if (this.platform.is('android')) // FileSystem.writeFile
Souleste
  • 1,887
  • 1
  • 12
  • 39

1 Answers1

0

There isn’t a way to access the Books app, however it is possible to save PDFs to the Books app.

There is an option to save PDFs to the books app in the system wide share sheet. All you would have to do is present a share sheet and pass in a PDF, it would automatically suggest the user places appropriate for a PDF file.

I’m not too sure how to present share sheet in ionic but here are some resources.

http://engineering.curalate.com/2017/03/09/ios-share-ext-with-ionic.html

https://ionicframework.com/docs/native/social-sharing

https://enappd.com/blog/social-sharing-component-in-ionic-5-mobile-web-apps/168/

Jonathan
  • 511
  • 4
  • 7