There is something magical about seeing the things you create come alive on the screen of an iPhone. The problem is that getting your content to show up on a device with an Apple logo is a hard trek at the best of times. There are simply so many hoops to jump: enrolling in the developer program, battling wayward libraries and insidious bugs, juggling provisioning profiles and finally undergoing that agonizing wait for your app to be approved. It's way too much effort if all you want to do is quickly browse through your content or give your client a very rough idea of how his content would look like on a smartphone.
We were well aware of this challenge and wanted to provide you with an easy tool for browsing entries from your space(s) without the need to go through a lengthy app development and approval process. Today, we'd like to introduce our first step in this direction - an iOS app for browsing the content created on Contentful. the Discovery app follows very straightforward logic: once you provide Delivery API credentials, it will display all entries and assets from your space on your iOS device.
Contentful differs from traditional CMSes in the way we separate actual content from how it is displayed on any given device (the so-called presentation layer). In building the Discovery app, we remained loyal to this distinction and opted to stick to a very basic look with only minimal styling. The few libraries we did use were Bypass library for rendering markdown as HTML and Apple's QuickLook framework to support asset preview, everything else you see is just default iOS styles.
Needless to say, you are free to use these libraries or implement your own ones as well as style your content in accordance with the logic and requirements of your app. While the Discovery app will not tell you how your content will look on the actual app you are about to deploy, it nonetheless helps you answer other important questions: How is my markup rendered in the app? Is the order of my fields be preserved? Is preview of a particular asset supported on the device? What kind of performance will I see with image-heavy posts? How responsive is the underlying API framework? You can answer all these and many other questions by simply playing around with the app or digging into log files on your device.
To access your content on the Discovery app, first go to the Content Delivery section in your space and make sure you generate at least one API key. Below the access token field, you will see a direct link to the app that will automatically supply login credentials if clicked on your device. Otherwise just copy & paste your space ID and access token into the app manually.
Inside the app, you can browse through content types, entries and assets. By default, we display entries in a raw, unstyled preview, but you can also toggle back to editor view to reveal proper field names. Remember that only published entries will show up in the app, those that have status set to 'draft' are not visible via Content Delivery API (CDA) and therefore not visible in the app. In case your space contains hundreds of entries you can also tap search to filter the list down to a more manageable size.
You can quickly skim through your assets by scrolling through the thumbnails or dig a bit deeper by clicking on individual items. In addition to the actual asset, the app also displays key meta-data associated with it. We scale down images to the optimal screen size to preserve your bandwidth. Plus, as mentioned above, the Discovery app leverages some iOS magic to preview most common asset types. Here is the full list of supported file formats:
- Microsoft Office docs;
- RTF and TXT docs;
- CSV files;
- PDF files;
- Audio (mp3 & acc);
- Videos (only mp4);
- Images*;
Don't worry if you haven't had time to create your own space yet, we shipped the app with the demo example, so you can always indulge your curiosity (and perhaps even learn something new) by browsing the demo space dedicated to the myths and characters of Ancient Greece. Even better news is that we open-source the app, so you can fork it on GitHub and in no time get your own, Contentful-powered mobile app up and running or download the Discovery App directly from iTunes App Store.
The Discovery app is also available on Android since Sep 2014. Read all about it in the blog, or download it from Google Play.
Happy browsing, folks!
- Including the format beloved by all cats & hipsters - animated GIFs.