Skip to content
This repository has been archived by the owner on Mar 26, 2018. It is now read-only.

Newsstand shelf JSON

Simbul edited this page Nov 19, 2012 · 13 revisions

To use Newsstand and make books/issues available for download in Baker 4.0 you need to put a JSON file on your server containing the list of the issues you want to make available (shelf manifest). Note that this is not the same as the JSON file containing your book info (book/issue manifest).

To point Baker to the JSON file, set the NEWSSTAND_MANIFEST_URL constant in Constants.h to the URL of the manifest, e.g. http://example.com/books.json.

Shelf manifest example

[
  {
    "name": "a-study-in-scarlet",
    "title": "A Study in Scarlet",
    "info": "The original masterpiece by Sir A. Conan Doyle",
    "date": "1887-10-10 10:10:10",
    "cover": "http://bakerframework.com/newsstand-books/a-study-in-scarlet.png",
    "url": "http://bakerframework.com/newsstand-books/a-study-in-scarlet.hpub"
  },
  {
    "name": "a-study-in-green",
    "title": "A Study in Green",
    "info": "An exciting remake of the original, with added mint!",
    "date": "2010-10-10 10:10:10",
    "cover": "http://bakerframework.com/newsstand-books/a-study-in-green.png",
    "url": "http://bakerframework.com/newsstand-books/a-study-in-green.hpub"
  },
  
  ...
  
]

Shelf manifest properties

  • name ( string ):
    A unique identifier for the issue. Note that both Newsstand and Baker rely on this ID, which should be unique and should never change. This property is used internally and it won't be shown to the user.
  • title ( string ):
    The title of your issue. This is what users will see in the shelf. It should generally match the title specified in your book.json.
  • date ( string ):
    The publication date for the issue, in the format YYYY-MM-DD HH:MM:SS. Note that issues in the shelf will be sorted according to the date (with the most recent ones on top). This property is used internally and it won't be shown to the user.
  • cover ( string ):
    The URL pointing to the cover for the selected issue. This is the cover that will be displayed in the shelf. It should generally match the cover specified in your book.json.
  • url ( string ):
    The URL pointing to the HPub file containing the issue. Baker will retrieve the issue from this URL every time a user decides to download it.
  • info ( string , optional):
    Some text that will be displayed below the title, in the shelf. It may be used to provide a summary of the content of an issue.

Note that, when Newsstand is enabled, Baker will not display any of the bundled books. In fact, you can delete the books folder from the Xcode project entirely.