4

I was recently asked if I could code a simple IPhone/IPad app that:

  1. Checks an FTP server for changes to a PDF file (easy)
  2. Downloads the lastest PDF (easy)
  3. Adds or replace the file on iBooks (hmm...)

I have tried to find any code that deals with inserting/adding/updating files inside iBooks, but sadly there is very little on the subject. Is this even possible except manually through iTunes? My gut feeling says that it's just a matter of writing the file to a folder..

It makes sense if it were such an API. There are many companies that would like to keep their product portfolios up to date, or research manuals that (in theory at least) could benefit greatly from being updated automatically through an app.

Any help or comments are welcome.

lxt
  • 31,146
  • 5
  • 78
  • 83
Jon Lennart Aasenden
  • 3,920
  • 2
  • 29
  • 44

2 Answers2

2

My gut feeling says that it's just a matter of writing the file to a folder..

Unfortunately, this probably isn't the case. I'd imagine iBooks using some sort of database to keep track of books, rather than simple files.

There is a URL schema for iBooks, but it's undocumented, and nobody has found any methods that would update/replace a book (I don't know if any even exist): How do I launch iBooks e-reader programmatically on iPad?

If you feel this is something that would be beneficial to iBooks, you should consider filing a feature request on the Apple dev site.

Community
  • 1
  • 1
lxt
  • 31,146
  • 5
  • 78
  • 83
  • "Unfortunately, this probably isn't the case" Yeah i figured as much, hence i thought i could post the question here. I work primarily on PC, but having worked on the mac for a while i find that solutions are either dead simple (i.e folders and files) or quite complex. – Jon Lennart Aasenden Feb 12 '11 at 17:34
2

UIDocumentInteractionController is your friend in this case

JustSid
  • 25,168
  • 7
  • 79
  • 97
  • M... not sure exactly what you mean here. Do you have any examples? From what i gather this will be helpfull if i want to display a pdf (i.e provide buildt in controls and views) but not replace a pdf that is registered under iBooks. – Jon Lennart Aasenden Feb 12 '11 at 17:36
  • @Jon Lennart Aasenden: The class allows you to open PDFs in iBooks, or at least gives the user the possibility to open the book there. The book will be added into the users iBook library and probably will replace existing ones (but not 100% sure about this). – JustSid Feb 12 '11 at 17:46
  • @Sid: Ah.. well it's a start. Thank you! – Jon Lennart Aasenden Feb 12 '11 at 18:55
  • @Jon Lennart Aasenden: Its not only a start, but currently (as of iOS 4.2.1) the only way to interact in this form with iBooks. If you need more, do what lxt suggested, file a feature request @ bugreport.apple.com – JustSid Feb 12 '11 at 21:43
  • Have been busy all week, but i think i might get what you mean. This is the same behavior that iTunes have yes? If i click a music file, it's automatically imported to itunes (unless i stop this behavior through settings). I will do some research and see how flexible it is. Apple's documentation didnt exactly avail much. – Jon Lennart Aasenden Feb 16 '11 at 21:35
  • It would seem in retrospect that Apple bolted the gates shut on this one. You have to go via iBooks or not at all. Oh how i love megalomania companies :P – Jon Lennart Aasenden Feb 22 '12 at 18:42