aclu-national / voter-apple-wallet

A command-line utility for generating Apple Wallet passes for ACLU Voter

Home Page:https://www.aclu.org/voter/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

voter-apple-wallet

A command-line utility for generating Apple Wallet passes for ACLU Voter.

Installation

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

Mapbox API key

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="..."

Apple Developer setup

You will need an active Apple Developer account to generate passes.

  1. Create a Pass Type Identifier
  2. Set the teamIdentifier and passTypeIdentifier in template/pass.json
  3. Get your certificates and place a [Pass Type ID].pem file into the template folder (e.g., template/org.aclu.voter.pem)

Usage

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.

Template

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": []
}

See also

About

A command-line utility for generating Apple Wallet passes for ACLU Voter

https://www.aclu.org/voter/

License:MIT License


Languages

Language:JavaScript 69.0%Language:Shell 31.0%