Book Image

Instant Passbook App Development for iOS How-to

By : Keith D. Moon
Book Image

Instant Passbook App Development for iOS How-to

By: Keith D. Moon

Overview of this book

With iOS 6, Apple introduced the Passbook app as a central digital wallet for all the store cards, coupons, boarding passes, and event tickets that have become a popular feature of apps. The passes in Passbook can be tied to relevant locations and times, providing additional visibility for your brand or service. Instant Passbook App Development for iOS How-to is a step-by-step walkthrough of how to create, customize, deliver, and update a pass for Passbook, the newest and most exciting iOS 6 feature. With sample code and clear instructions you will be guided through the process and helped to avoid the pitfalls. Instant Passbook App Development for iOS How-to helps you understand Apple's Passbook feature, leading you through creating and distributing your first pass. Clear step-by-step instructions, along with sample code and resources, will get you up and running so you can integrate Passbook into your app or service. With this book you will learn how to create, customize, sign, deliver, and update your Passbook pass, with the help of sample code and clear instructions.
Table of Contents (7 chapters)

Preface

Instant Passbook App Development for iOS How-to will get you up and running with Passbook, Apple's digital wallet, introduced in iOS. Passbook provides a way for users to collect and organize coupons, store cards, event tickets, and boarding passes, and your product or service can take advantage of this opportunity. This book will explain the Passbook infrastructure, lead you through creating your first Pass, covering delivering your Passes to users, and keeping them up-to-date.

What this book covers

Understanding Passbook (Simple) introduces you to Passbook. Apple's Passbook feature is a collection of technologies that come together to provide digital wallet functionality to the user. We will understand what Passbook consists of, from both the user and Pass creator perspective.

Setting up your environment (Simple) guides you through creating a Pass. Creating your first Pass will require cryptographic keys and certificates, managed through Apple's Developer Portal. You will be lead through this, preparing everything needed to create your first Pass.

Creating your Pass (Medium) covers all the elements that go into a Pass. You will be taken through the creation of a Pass from beginning to end.

Signing your Pass (Simple) explains how to digitally sign the Pass package content. To be accepted into the Passbook app, a Pass must be cryptographically signed with the developer's certificate. We will sign the newly created Pass with the certificate prepared from your Apple Developer account.

Delivering your Pass via e-mail (Medium) explores how Passes can be delivered as e-mails. Once created, your Pass needs to be delivered to your users. We will send an e-mail with your Pass attached, in a way that allows it to be opened directly into Passbook.

Delivering your Pass via a web link (Medium) shows you how to configure your web server to serve up Passes to your users. This will allow Passes to be delivered though links from your website.

Delivering your Pass via an app (Medium) shows how Passes can be delivered through a companion iOS app. We will use the PassKit framework available in iOS to present a Pass to the user in a companion app. From there the Pass can be added into the Passbook App.

Updating a Pass within the Passbook app (Advanced) will implement a REST API in Ruby that matches Apple's defined specification. This will allow Passes to be updated when circumstances change.

What you need for this book

Who this book is for

This book is intended for those looking to take advantage of Passbook, the latest feature in iOS. Readers with familiarity with the iOS platform and with programming concepts will get the most from this book. While you will be lead through each part of the process step-by-step, readers with experience in building and packaging apps for the iOS platform will find familiar concepts.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "Pass files with the -pkpass file extension will open in a preview window."

A block of code is set as follows:

if (![PKPassLibraryisPassLibraryAvailable]) {
    NSLog(@"Passbook not available on this device");
    return;       
}

Any command-line input or output is written as follows:

cd passbook_rails_example
bundle

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Clicking on the Add to Passbook button will place the Pass in the Passbook associated with the iCloud account set up in OSX system preferences".

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.