Prerequisites
You will need the following:
A PassKit account
Your PassKit SDK Credentials
Apple wallet certificate id (for flights only)
Getting started
Download or clone this quickstart repository, create a folder
credentials
in the resources folder of the repository and add the following three PassKit SDK credential files :certificate.pem
ca-chain.pem
key-java.pem
You can disregard the key.pem credentials file as it is not compatible with Java.
Edit
passkit.properties
in the resources folderIf you wish to receive enrollment emails for loyalty or coupon cards edit
baseEmail
andvipEmail
on lines 77 and 78 in QuickstartLoyalty for loyalty, and lines 70 and 71 in QuickstartCoupons for coupons.If you are using flights edit
appleCertificate
on line 59 in QuickstartFlights
Once you have set up the certificates and any other variables from the above steps you can then pick one of the pre-made templates to start getting up and running with the PassKit SDK.
Membership/Loyalty Templates
These templates can be found in the QuickstartLoyalty file in 'src/main/java/com/passkit/quickstart' and contain the basic fields for each of the actions, additional fields or templates can be made based on the calls found here.
Create image assets for the pass
Create default pass templates for tiers
Create a new tier
Create a loyalty program with a previously made tier
Enrol a member in each tier
Check-in a member
Check-out a member
Add loyalty points to a member
Delete all membership assests
Coupons Templates
These templates can be found in the QuickstartCoupons file in 'src/main/java/com/passkit/quickstart' and contain the basic fields for each of the actions, additional fields or templates can be made based on the calls found here.
Create image assets for coupons
Create a campaign
Modify a campaign
Create an offer
Enrol customer on offer
Redeem a coupon
Delete an offer
Flights Templates
These templates can be found in the QuickstartFlightTickets file in 'src/main/java/com/passkit/quickstart' and contain the basic fields for each of the actions, additional fields or templates can be made based on the calls found here.
Create image assets for flight tickets
Create default template for a regular flight ticket
Create a flight
Create an airport
Issue a basic ticket (auto create an event)
Delete all ticket assets
Event Tickets Templates
These templates can be found in the QuickstartEventTickets file in 'src/main/java/com/passkit/quickstart' and contain the basic fields for each of the actions, additional fields or templates can be made based on the calls found here.
Create image assets
Create default template for an event ticket
Create a venue
Create a production
Create ticket type
Issue a ticket
Validate ticket
Redeem ticket
Delete all ticket assets
For implementing in your own projects, use the GrpcConnection class to manage connection to the PassKit gRPC endpoints.
Use the GrpcConnection's ManagedChannel object to create the stubs you require in your implementation.
Testing Templates
Membership/Loyalty: Run
gradle test --tests QuickstartLoyaltyTest
.Event Tickets: Run
gradle test --tests QuickstartEventTicketsTest
.Coupons: Run
gradle test --tests QuickstartCouponsTest
.Flight Tickets: Run
gradle test --tests QuickstartFlightTicketsTest
.
Note: If you don't plan to use certain templates, consider deleting them from the quickstart files to avoid unintended actions.
This comprehensive guide will help you set up the PassKit Java SDK, configure credentials, and explore a variety of pre-made templates to streamline your PassKit integration.