How to create pkpass file dynamically in java?

4.8k views Asked by At

I am integrating Apple wallet functionality in my website.

As I understood, we have to create the .pkpass file from pass.json, signature and manifest.json...etc . But this is for static coupon, but i am generating the coupon / pass dynamically and want to create the .pkpass file also dynamically based on the customer details. I will create different coupon for different customers and should generate the .pkpass file.

How can this be done? How can I create a .pkpass file dynamically for a each row on click of an "Add to Apple wallet" button? is there any thirdparty service available?

Thanks in advance

1

There are 1 answers

0
Sreedhar S On

I have used jpasskit library which is a opensource library available in github for Java. You can add the Jpasskit library to your springboot application via maven dependency, as below,

<dependency>
        <groupId>de.brendamour</groupId>
        <artifactId>jpasskit</artifactId>
        <version>0.1.2</version>
    </dependency>

Also you can follow the below step by step procedure to get the dynamic passes in Java by Rest API using Springboot frame work as described in the medium article.

https://medium.com/@mumtazparbhin/create-rest-api-to-download-apple-wallet-pkpass-file-using-spring-java-bd66e4eb8f3e