Pass barcodes.
Which formats a pass can carry, which count as square, and the field budget a square code costs you.
A pass carries its barcode in barcodes[]: a format, a message, an encoding and optional altText. QR and Aztec are square, and a square barcode halves the room for secondary and auxiliary fields on three of the five styles.
- Square
- QR and Aztec. PDF417 and Code 128 are not.
- The cost
- Four secondary and auxiliary fields combined on store cards, coupons and generic passes.
- altText
- Human-readable text under the code.
Four formats, two square.
| format | Symbology | Square | Use it for |
|---|---|---|---|
PKBarcodeFormatQR |
QR code | Yes | Links, vCards: the default for anything a phone camera should read. |
PKBarcodeFormatAztec |
Aztec | Yes | Transport tickets; reads well off a screen. |
PKBarcodeFormatPDF417 |
PDF417 | No | Boarding passes and ID-style scanners. |
PKBarcodeFormatCode128 |
Code 128 | No | One-dimensional retail scanners. Apple notes it is not shown on Apple Watch. |
Square is read from pass-spec.js, the module Cardr’s pass builder obeys.
| Style | Secondary + auxiliary with a square barcode |
|---|---|
| Generic | 4 combined |
| Store card | 4 combined |
| Coupon | 4 combined |
| Event ticket | Independent limits |
| Boarding pass | Independent limits |
Apple: “Coupons, store cards, and generic passes with a square barcode can have a total of up to four secondary and auxiliary fields, combined.”
The barcode Cardr ships.
{
"barcodes": [
{
"format": "PKBarcodeFormatQR",
"message": "https://cardr.co/u/jordan?c=qr",
"messageEncoding": "iso-8859-1"
}
]
}
Barcode questions.
What is altText?
Text shown under the barcode, such as a ticket number. It is optional; leave it out when the barcode carries a link nobody needs to read.
Why did my fields disappear when I added a QR code?
A square barcode takes the space: store cards, coupons and generic passes then get four secondary and auxiliary fields between them, not four each. Wallet drops the extras without warning. The .pkpass viewer flags it.
barcode or barcodes?
barcodes, an array; Wallet shows the first format the device supports. The single barcode key is deprecated.