The easiest way to create Apple Wallet Pass
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
During my work I need to implement Apple Pass creation. I was so confused after reading Apple Docs, I have need to read many articles and other sources before I created my first pass. - So I decided to create simple straight tutorial even for my self to not search it again in the feature. Help yourself and play with it. It is working on my computer :)
To create Apple Wallet Pass you need .pkpass
file. This file is basically a .zip
file,
with specific file structure and a lot of secure stuff inside. You have to meet a few requirements to successfully
install it on device. If you have the file You can deploy it on the device how you want.
It could be: mobile app, web app, email, etc.
Apple provided link to samples in latest docs, but site under link refused me access to samples. Fortunately I found working link in archival docs. If You faced the same issue use this link. Later in tutorial I'm using exactly this samples.
Link to samples: https://developer.apple.com/services-account/download?path=/iOS/Wallet_Support_Materials/WalletCompanionFiles.zip
The first step is to enroll Apple Developer program. The cost of it is 99$, but than you have to wait before Apple accept your license. You don't need Mac for follow this steps, but on end you need to test your pass on Apple device or simulator.
Note that: The latest version of openssl (ver >=3.0) do not support .p12 files well. When I was trying to play with latest version I was getting error and empty results files. It works on version 1.1. Here is example how to install it on Mac:
- openssl
brew install [email protected] ; brew link --overwrite [email protected]
-
Create private key
openssl genrsa -out pkpass.key 2048
-
Generate a certificate singing request (.csr)
openssl req -new -key pkpass.key -out pkpass.csr
-
Export this file to
.pem
formatopenssl x509 -inform der -in pass.cer -out pass.pem
-
Upload your request file.
-
Use this link to create a new one
-
Download your
pass.cer
file. -
Export this file to
.pem
formatopenssl x509 -inform der -in pass.cer -out pass.pem
-
Download Apple WWDR G4 cert wwdr cert
-
Export this cert to
.pem
openssl x509 -inform der -in AppleWWDRCA.cer -out wwdr.pem
-
Get pass samples - I don't know why developer portal show that I do not meet some requirements to download this samples. I don't know why, but I found another link in archive docs.
-
Copy sample to create
.pkpass
cp -r WalletCompanionFiles/SamplePasses/BoardingPass.pass ./BoardingPasss.pass
-
Update
BoaringPass.pass/pass.json
file with data used to create your certs. Especially two fields:passTypeIdentifier
- You provided it during uploading request. Probably it's in formatpass.com.reversed.domain
teamIdentifier
- It's Your Apple Developer ID. You can find it here (Team ID field)
-
Create
manifest.json
. It's.json
file with checksum of every file. It should look like this:{ "icon.png" : "2a1625e1e1b3b38573d086b5ec158f72f11283a0", "[email protected]" : "7321a3b7f47d1971910db486330c172a720c3e4b", "[email protected]" : "7321a3b7f47d1971910db486330c172a720c3e4b", "pass.json" : "ef3f648e787a16ac49fff2c0daa8615e1fa15df9" }
This file contain sha1 hash of every file. To create this hash use this comman
openssl sha1 <filename>
-
Generate signification of the file
openssl smime -binary -sign -certfile wwdr.pem -signer pass_cert.pem -inkey pass_key.pem -in manifest.json -out signature -outform DER -passin pass:<your_password>
-
Put this
signification
file intoBoardingPass.pass
folder -
Zip
BoardingPass.pass
folder
zip -r bording.pkpass manifest.json pass.json signature icon.png [email protected] logo.png [email protected]
Note that: if pass not working on device use this validator to see what did you do wrong
I found great visual designer app for Apple Wallet Passes. You can find it under this link I found it in readme of this nodejs lib. For the first time I recommend to try with original apple samples to be sure if everything works, but You can also start from creating Your own pass.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Roland Sobczak - @linkedin_handle - [email protected]
Project Link: https://github.com/RolandSobczak/AppleWalletPassCreation