Skip to content

RolandSobczak/AppleWalletPassCreation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


Apple Pass Creation Guide

The easiest way to create Apple Wallet Pass
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. How it works
  3. Samples
  4. Getting Started
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

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 :)

(back to top)

How it works

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.

Samples

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

Getting Started

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.

Prerequisites

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:

Apple Wallet Pass creation process

  1. Create private key

    openssl genrsa -out pkpass.key 2048
  2. Generate a certificate singing request (.csr)

    openssl req -new -key pkpass.key -out pkpass.csr
  3. Export this file to .pem format

    openssl x509 -inform der -in pass.cer -out pass.pem
  4. Upload your request file.

  5. Use this link to create a new one

  6. Download your pass.cer file.

  7. Export this file to .pem format

    openssl x509 -inform der -in pass.cer -out pass.pem
  8. Download Apple WWDR G4 cert wwdr cert

  9. Export this cert to .pem

    openssl x509 -inform der -in AppleWWDRCA.cer -out wwdr.pem
  10. 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.

  11. Copy sample to create .pkpass

cp -r WalletCompanionFiles/SamplePasses/BoardingPass.pass ./BoardingPasss.pass
  1. 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 format pass.com.reversed.domain
    • teamIdentifier - It's Your Apple Developer ID. You can find it here (Team ID field)
  2. 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>
  3. 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>
  1. Put this signification file into BoardingPass.pass folder

  2. 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

(back to top)

GUI Editor

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.

Contributing

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Roland Sobczak - @linkedin_handle - [email protected]

Project Link: https://github.com/RolandSobczak/AppleWalletPassCreation

(back to top)

Acknowledgments

(back to top)

About

Simple tutorial for Apple Wallet Pass creation process

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published