A command-line utility for generating Apple Wallet passes for ACLU Voter.
The script relies on a fork of node-passbook to generate .pkpass
files. It expects to run on Node v10 on Ubuntu 16.04.
$ npm install
ImageMagick is used to add a pin icon to the map.
$ sudo apt update
$ sudo apt install -y imagemagick
The map on the pass comes from the Mapbox Static API. You'll need to create an API token and define it as an environment variable.
$ export MAPBOX_API_KEY="..."
You will need an active Apple Developer account to generate passes.
- Create a Pass Type Identifier
- Set the
teamIdentifier
andpassTypeIdentifier
intemplate/pass.json
- Get your certificates and place a
[Pass Type ID].pem
file into thetemplate
folder (e.g.,template/org.aclu.voter.pem
)
Use the included shell script to invoke the pass generator.
$ pkpass.sh [address] [hours] [lat] [lng]
That will generate a new file called pass.pkpass
that you can drag and drop onto the iOS Simulator app to view.
The template
folder contains all the files used to generate the pass. Edit pass.json
to experiment with alternate pass types and default content:
"eventTicket": {
"primaryFields": [],
"secondaryFields": [],
"auxiliaryFields": []
}