You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+92-3
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,15 @@
1
1
# Passcards
2
2
3
-
A simple Wallet (née Passbook) server. This is a Swift re-implementation of the original [Parse-backed version](https://github.com/a2/passcards-parse).
3
+
A simple [Wallet](https://developer.apple.com/wallet/) server that implements the [PassKit Web Service](https://developer.apple.com/library/content/documentation/PassKit/Reference/PassKit_WebService/WebService.html) requirements. (This is a Swift re-implementation of the original [Parse-backed version](https://github.com/a2/passcards-parse).)
2. Set the environment variables (as described above)
40
+
41
+
```sh
42
+
$ heroku config:set X=abc Y=def Z=ghi ...
43
+
```
44
+
45
+
If you use the [Heroku PostgreSQL](https://devcenter.heroku.com/articles/heroku-postgresql) plugin, you will need to add the plugin (which sets the `DATABASE_URL` environment variable) and thenset the required `PG_*` variables.
46
+
47
+
3. Install the [Container Registry Plugin](https://devcenter.heroku.com/articles/container-registry-and-runtime)
This is beyond the scope of the project, but recommended reading includes:
70
+
71
+
- Wallet Developer Guide: [Building Your First Pass](https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/PassKit_PG/YourFirst.html#//apple_ref/doc/uid/TP40012195-CH2-SW1), [Pass Design and Creation](https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/PassKit_PG/Creating.html#//apple_ref/doc/uid/TP40012195-CH4-SW1)
72
+
- [PassKit Package Format Reference](https://developer.apple.com/library/content/documentation/UserExperience/Reference/PassKit_Bundle/Chapters/Introduction.html)
73
+
74
+
You will want to set _https://my-heroku-app.herokuapp.com/_ as the `webServiceURL` root key in your _pass.json_.
75
+
76
+
Example passes, as well as the source of a command-line tool for signing Pass bundles (_signpass_), can be found [here](https://developer.apple.com/services-account/download?path=/iOS/Wallet_Support_Materials/WalletCompanionFiles.zip).
In the above cURL command, _a_local_file.pkpass_ is a file in the current working directory. Set the `authentication_token`, `pass_type_identifier`, and `serial_number` fields to their corresponding values from the pass's _pass.json_. _MY_UPDATE_PASSWORD_ is the `UPDATE_PASSWORD` environment variable set in your app.
On my personal website (*https://pass.a2.io*), I use [CloudFlare](https://www.cloudflare.com) to secure the website subdomain that points to Heroku because then I get TLS / HTTPS (which is required for PassKit in production) for free, because I'm cheap. To that extent, I also use Heroku's free PostgreSQL plan and the [free dyno hours](https://devcenter.heroku.com/articles/free-dyno-hours).
114
+
115
+
A sleeping-when-idle Heroku app is *perfect* for Wallet services because an iOS device will call your service endpoints in the background and retry upon timeout.
116
+
117
+
Your app service service is only woken...
118
+
119
+
1. when someone adds a pass (triggering a pass registration).
120
+
2. when someone deletes a pass (triggering pass de-registration).
121
+
3. when someone triggers a manual refresh of a pass.
122
+
4. when someone toggles "Automatic Updates" on the backside of a pass (shown with the ⓘ button).
123
+
35
124
## License
36
125
37
126
Passcards is available under the MIT license. See the LICENSE file for more info.
0 commit comments