Apple Wallet & Google Pass Builder

Visually architect pass.json structures for Apple Wallet (.pkpass) and Google Wallet passes.

Payload Size 0 KB
Active Fields 4
Architecture PKPass
SFO
San Fran
JFK
New York
PASSENGER
JOHN DOE
CLASS
FIRST
TICKET-JW902-JOHNDOE
If you don't use our client-side ZIP exporter, you can manually compile a .pkpass archive. Apple strictly requires a valid PKCS#7 signature to install the pass on an iOS device.
1. Prepare Certificates
# Convert Apple p12 to PEM format openssl pkcs12 -in pass_cert.p12 -clcerts -nokeys -out pass_cert.pem openssl pkcs12 -in pass_cert.p12 -nocerts -out pass_key.pem
2. Generate Manifest
{ "pass.json": "00085a1112443c21a41...", "icon.png": "3f4a47b..." }
3. Cryptographic Compile
# Generate the PKCS#7 signature file openssl smime -sign -signer pass_cert.pem -inkey pass_key.pem -certfile WWDR.pem -in manifest.json -out signature -outform DER -binary # Zip the payload into the final .pkpass file zip -r mypass.pkpass manifest.json signature pass.json icon.png logo.png

1What is an Apple Wallet .pkpass File?

To the end user, an Apple Wallet pass appears as a beautiful, interactive digital card on their iPhone screen. However, from a software engineering perspective, a .pkpass file is fundamentally a compressed ZIP archive wrapped in a specialized Apple-specific extension. It is not an HTML file, nor is it a standalone application executable. The elegance of Apple Wallet lies in its strict, declarative architecture.

When a user downloads a .pkpass file, the iOS operating system unzips it in memory and parses the core foundation: a single, monolithic pass.json file. This JSON payload acts as the architectural blueprint. It defines every string of text, every color hex code, the pass type classification, and the mapping of physical layout constraints. Unlike web development, you cannot write custom CSS or JavaScript to style the pass. iOS takes the declarative instructions from your JSON and renders them securely using native SwiftUI components. This rigid framework guarantees blazing-fast load times, extreme battery efficiency on the Lock Screen, and absolute consistency across the Apple ecosystem.

Cross-Platform Compatibility: While Apple invented the .pkpass standard, it has become the de facto universal format for mobile wallets. Google Wallet (formerly Google Pay) APIs inherently support parsing .pkpass bundles, extracting the semantic data to render identical Android-native passes without requiring developers to maintain two entirely separate codebase standards.

2Cryptographic Security & PKCS#7 Signatures

Because Wallet passes can represent highly sensitive assets—such as $10,000 airline tickets, VIP event access, or high-limit store credit—Apple engineered a zero-trust cryptographic compilation process. You cannot simply compress a folder into a ZIP, rename it to .pkpass, and email it to an iPhone. If you attempt this, iOS will immediately reject the payload with a fatal "Pass cannot be read" exception.

The deployment pipeline mandates three distinct cryptographic steps. First, the compiler must iterate through every single asset in the bundle (e.g., pass.json, icon.png, logo.png) and generate a SHA-1 hash for each file. These hashes are consolidated into a pristine manifest.json dictionary. This manifest acts as a tamper-evident seal; if a malicious actor intercepts the pass and alters a single pixel of the logo or modifies the seat number in the JSON, the file's hash will break the manifest.

The second step requires cryptographic endorsement. Developers must utilize their private Apple Developer Pass Type ID Certificate (issued directly via the Apple Developer portal) in conjunction with the Apple Worldwide Developer Relations (WWDR) Intermediate Certificate. Using an algorithm like OpenSSL, the server signs the manifest.json to generate a detached PKCS#7 cryptographic signature file (literally named signature with no extension). Finally, the entire payload is zipped into the final .pkpass container. This guarantees to iOS that the pass was undeniably created by your authenticated Apple Developer account and has not been altered in transit.

3The pass.json Anatomy & Hierarchy

The anatomy of the pass.json dictionary is strictly hierarchical. At the absolute root of the object, developers must define the top-level standard keys. This includes the formatVersion (always integer 1), the teamIdentifier (your 10-character alphanumeric Apple Developer ID), and the passTypeIdentifier (the reverse-DNS string matching your cryptographic certificate, e.g., pass.com.acme.airline).

Beneath the metadata, you inject the aesthetic payload: backgroundColor, foregroundColor, and labelColor. These dictate the color palette of the native iOS UI container. However, the most critical component of the root JSON is the Style Dictionary. Apple enforces five distinct structural paradigms: boardingPass, coupon, eventTicket, storeCard, and generic. You must declare exactly one of these keys at the root, and its value is an object containing arrays of rendering fields.

Inside your chosen Style Dictionary, you build the text layout using specific field arrays. Primary Fields are rendered in the largest font weight at the top of the pass. Secondary Fields appear beneath them. Auxiliary Fields are rendered in the smallest font above the barcode. Finally, Back Fields are invisible on the front of the pass but become accessible when the user taps the info ("i") icon, flipping the digital card over to reveal terms, conditions, or extensive metadata.

4Pass Type Constraints

Selecting the correct Style Dictionary is not merely semantic; it completely alters the physical rendering engine inside iOS. A boardingPass is heavily constrained. If you invoke the boarding pass style, Apple mandates the inclusion of a transitType key (e.g., PKTransitTypeAir or PKTransitTypeTrain). iOS uses this key to automatically render a native vector icon (like an airplane or a locomotive) directly between your Primary Fields (Origin and Destination).

In contrast, a coupon or storeCard fundamentally rejects the split-primary header layout. Instead, these styles prioritize promotional imagery, dedicating a massive portion of the screen real estate to a strip.png hero image. If you attempt to use a transitType inside a coupon, the iOS JSON parser will silently fail or ignore the key entirely. Developers must understand these constraints intimately to avoid layout collisions, text truncation on smaller iPhone SE screens, or outright installation failures.

5Leveraging the Semantics Dictionary

Perhaps the most profound upgrade to the Wallet ecosystem occurred in iOS 15 with the introduction of the semantics dictionary. Historically, iOS treated the text fields on a pass as dumb strings. It didn't know if "JFK" meant John F. Kennedy Airport or "Just For Kids" apparel. The semantics dictionary bridges the gap between raw data and machine learning context.

By injecting a semantics object at the root of your JSON, developers can define over 70 strict contextual keys, such as flightCode, transitProvider, eventStartDate, duration, and venueName. When this data is present, the operating system feeds it directly into Siri's CoreML engine. This empowers iOS to proactively suggest the pass on the Lock Screen precisely when the flight is boarding, push it to the Apple Watch Smart Stack dynamically, or allow users to search for the pass in Spotlight using natural language (e.g., "Show my United flight pass"). Failing to implement semantics in modern passes severely kneecaps the user experience and is a hallmark of legacy, unoptimized deployments.

6NFC Payloads & Apple Pay VAS

While barcodes (QR, Aztec, PDF417) remain the global standard for optical scanning, Apple Wallet supports cutting-edge Near Field Communication (NFC) via the Apple Pay Value Added Services (VAS) protocol. To utilize this, a developer must inject an nfc dictionary into the JSON payload.

This dictionary contains two critical strings: the message (the actual secret payload transmitted to the reader) and the encryptionPublicKey (the cryptographic key ensuring the payload cannot be intercepted over the air). When a user taps their iPhone to a compatible NFC terminal, iOS authenticates the interaction (often requiring Face ID or Touch ID) and securely beams the payload.

NFC Entitlement Warning: You cannot arbitrarily test or deploy NFC passes. Apple restricts NFC functionality exclusively to developers who have applied for and been granted a special cryptographic NFC Entitlement via their Apple Developer account. If you attempt to include an NFC dictionary without the corresponding certificate entitlement, the pass will fail compilation.

7Web Service Endpoints & Live Push

A static pass is useful, but a dynamic pass is revolutionary. Apple Wallet supports live updates, allowing enterprises to seamlessly push gate changes, loyalty point balance updates, or coupon expirations directly to the user's device. Implementing this requires exposing a strict REST API and declaring a webServiceURL and an authenticationToken inside the pass.json.

When a user installs the pass, the iOS `passd` daemon automatically initiates a POST request to your API, registering the device's Push Token against the specific pass serial number. When an enterprise backend dictates a change (e.g., a flight delay), it does not send the new pass directly to the phone. Instead, the server sends a tiny, empty Apple Push Notification (APN) to the device. The device silently wakes up in the background, hits your webServiceURL, asks for the latest pass manifest, downloads the new ZIP payload, and smoothly updates the UI, often accompanied by an automated Lock Screen alert detailing the change.

8Location Triggers & Geofencing

Proactive surfacing is a core tenet of the iOS experience. By utilizing the locations and beacons arrays within the JSON payload, developers can bind geographical triggers to the pass. The locations array accepts GPS latitude, longitude, and an optional altitude/maxDistance radius.

When the device crosses this geofence boundary, iOS intelligently evaluates the time relevance and displays the pass on the Lock Screen alongside a custom relevantText string (e.g., "Welcome to Starbucks! Tap to pay with your Gold Card."). For micro-location precision (e.g., walking past a specific aisle in a retail store), developers can configure beacons arrays mapped to specific Bluetooth Low Energy (BLE) UUIDs. To preserve system memory and battery, Apple enforces a hard limit: a single pass can contain a maximum combination of 10 locations and beacons.

9Image Asset Architecture & Retina

Apple's uncompromising stance on visual fidelity requires meticulous image asset management. Every PNG image in the bundle must be supplied in three distinct resolutions: standard (@1x), Retina (@2x), and Super Retina (@3x). For example, the core icon.png (which appears in push notifications and Apple Watch UI) must be supplied as icon.png (29x29), icon@2x.png (58x58), and icon@3x.png (87x87).

Similarly, the logo.png is restricted to a maximum width of 160px (or 480px for the @3x variant). The strip.png hero image must account for varying screen sizes, typically spanning the full width of the device (375px @1x for modern iPhones). Failing to include proper Retina assets will result in blurred, highly unprofessional renderings on modern OLED Super Retina XDR displays, severely damaging enterprise brand perception.

10Debugging Pass Compilation Failures

The most frustrating experience for a Wallet developer is the opaque "Pass cannot be read" error generated by iOS during installation. Because Apple intentionally obfuscates security failures from the end-user, debugging requires physical telemetry.

To diagnose the true root cause, developers must connect their iPhone directly to a macOS machine via a Lightning or USB-C cable. Open the native Console.app on the Mac, select the connected iPhone from the sidebar, and aggressively filter the logs using the keyword "Passbook" (the legacy internal codename for Wallet). When you attempt to install the corrupted pass again, the console will stream the raw passd daemon logs. These logs explicitly expose the failure state: whether it was a JSON syntax error, an invalid date formatting string (e.g., failing to use strict W3C ISO 8601 formatting), a hash mismatch in the manifest, or an expired cryptographic WWDR certificate.

FAQFrequently Asked Questions

How do I cryptographically sign a .pkpass file on Windows or Linux?
Signing a .pkpass outside of macOS requires OpenSSL. First, convert your Apple Developer Pass Type ID certificate (.p12) into a PEM format. You must also download the WWDR Intermediate Certificate. Generate a manifest.json containing SHA1 hashes of all files. Then, use OpenSSL smime to generate a detached PKCS#7 signature over the manifest using your PEM keys. Finally, zip the payload. Our tool provides the exact CLI commands in the Compiler tab.
What is the difference between primaryFields, secondaryFields, and auxiliaryFields?
primaryFields render as the largest header text on the pass. secondaryFields render below the primary fields in medium font. auxiliaryFields render below secondary fields in a smaller font. The exact layout constraints (how many fit before truncation) depend heavily on the style of the pass (e.g., boardingPass vs. coupon).
Why is my pass failing to install on an iPhone with a "Pass cannot be read" error?
This generic error usually means one of three things: 1) Your cryptographic signature is invalid or signed with the wrong certificate. 2) Your manifest.json has a mismatched SHA1 hash for a file, or is missing a file. 3) Your pass.json contains a syntax error or is missing required keys like teamIdentifier, passTypeIdentifier, or the specific style dictionary.
How do I implement live push notification updates for Wallet passes?
To enable live updates, your pass.json must include a webServiceURL and an authenticationToken. When a user adds the pass, iOS makes a POST request to your URL to register the device. To push an update, your server sends an Apple Push Notification (APN) to the device, which silently prompts iOS to hit your webServiceURL and download the newly generated .pkpass bundle.
What is the semantics dictionary and why is it important in iOS 15+?
Introduced in iOS 15, the semantics dictionary is a machine-readable payload inside pass.json that helps Apple Intelligence (Siri, Spotlight, and watchOS) understand the context of the pass. By supplying fields like flightCode, transitProvider, or eventStartDate, iOS can proactively suggest the pass on the Lock Screen or Apple Watch Smart Stack at exactly the right time, without relying solely on geofencing.
How does geofencing work with Apple Wallet passes?
You can add a locations array to pass.json containing latitude and longitude coordinates. When the device enters a 100-meter radius of those coordinates, the pass appears on the Lock Screen alongside a custom relevantText message. Note that Apple restricts the number of locations to a maximum of 10 per pass.
Can I use custom fonts or CSS inside a .pkpass file?
No. A .pkpass file is not an HTML/CSS webpage. It is a strictly structured JSON payload. Apple Wallet parses the JSON and renders the pass using native Swift UI components. The only styling options available are backgroundColor, foregroundColor, labelColor, and specific image assets like logo.png and strip.png.
What are the required dimensions for Apple Wallet image assets?
Images must be provided in standard and Retina sizes (@2x, @3x). For example, an icon.png should be 29x29, icon@2x.png is 58x58, and icon@3x.png is 87x87. The logo.png max width is 160px (or 480px for @3x). Strip images (strip.png) vary heavily by pass type, but generally span the full width of the card (320px or 375px @1x).
How do I link an iOS App Store app to the back of a Wallet pass?
You can link a native iOS app by adding an array called associatedStoreIdentifiers to your pass.json, containing the numeric App Store ID (e.g., [284815942]). If the user doesn't have the app installed, the back of the pass will show a direct download link. If they do have it, it will show an "Open App" button.
What barcode formats are natively supported by Apple Wallet?
Apple Wallet natively supports four 2D barcode formats: PKBarcodeFormatQR (Standard QR Code), PKBarcodeFormatPDF417 (Standard for airline boarding passes), PKBarcodeFormatAztec (High-density matrix), and PKBarcodeFormatCode128 (1D barcode, though generally discouraged due to screen scanning difficulty). You must define the format and the message payload in the barcodes array of pass.json.
Can I include NFC payloads for Apple Pay integration?
Yes, if you have a special entitlement from Apple. By adding an nfc dictionary to your pass.json containing a message and encryptionPublicKey, the pass can interact with Apple Pay Value Added Services (VAS) terminals. When the user taps their phone, the terminal receives the encrypted NFC payload. This is commonly used for contactless student IDs, hotel keys, and transit cards.

Rate Apple Wallet & Google Pass Builder

Help us improve by rating this tool.

4.7/5
470 reviews