Month: July 2013

There are different types of images that can be added to a passbook pass and the pass style controls which ones are supported. The images have to be included in the .pkpass archive using standard names: background.png, footer.png, icon.png, logo.png, strip.png and thumbnail.png.

After introducing Passbook here, this post will show what is really a passbook pass.

A passbook pass is just a compressed file, a .zip archive, but with a “.pkpass” extension. This compressed pass must be cryptographically signed.

The .pkpass includes 3 necessary files:

manifest.json
The manifest is a JSON file that lists the archives in the .pkpass, calculate the SHA-1 hash of their content and store the hash in a dictionary. The manifest file itself and the signature file are not included. An example of the manifest file content is:

pass.json
A JSON dictionary that defines the pass. It describes the type of pass and the content of its fields. The JSON structure is described in detail in the Apple developer library.

signature
This file is a detached PKCS #7 signature of the manifest file. The signature is created using the private key associated with our signing certificate and using the WWDR intermediate certificate. The Worldwide Developer Relations (WWDR) certificate can be downloaded from here.

The zip archive also contains the images of the pass. The images are included inside the pass using standard names as we will see in another post.

To support localization, the structure of the .pkpass archive changes. For each supported location, it is necessary to create a subfolder to separate the files that depend on the location. For example create a subfolder named “es.lproj” and create a strings file named “pass.strings” that contains the Spanish strings. These strings will be referenced from the pass.

Passbook is an application included in iOS 6 which allows a user to store tickets or passes. These passes can be downloaded from other applications, from the browser or from the email. They have a front space to show the most important data and a back space to show some details and additional options.

Passbook is not available for iPad.

Back options

On the back of some passes, the user can activate the “Show On Lock Screen” option. This option will show the pass in the lockscreen at a specific hour or location. The option “Automatic Updates” will update the pass automatically without any user interaction.

In order to provide this options to our users, we need to have implemented an Apple Push Notification Service.

Barcodes

Passes contain barcodes that can be scanned to display their information. Passbook supports the following 2D barcode formats: QR, Aztec and PDF417. Next to the barcode image, we can add a text label to make the barcode human-readable in case it could not be scanned.

Best Practices

In the Passbook Programming Guide, there are some recommendations to take into account when designing and creating our passes. I highlight the following best practices:

Add a link to your application in the back of the pass.

Use an alternative text to the barcode.

Create policies regarding when passes can be redeemed. Remember that these policies are your responsability: control duplicates and expiration dates.

On the front space, the contents of fields must be brief. Show the rest of the information on the back of the pass.

Passes in Android

There are some applications in Google Play that import and store Passbook passes, so Android users can choose between different options.
One of the best is PassWallet from Attido Mobile (PassWallet – Passbook + NFC).