Darshan
Darshan

Reputation: 2379

How to create .pkpass file for apple wallet on serverside and get it on iOS side

Here I have created .pkpass file following this tutorial Manually

the above approach is static

What I want is to generate somehow the pkpass file on the server side and then open it from my iPhone/iPad device.

Upvotes: 1

Views: 5463

Answers (1)

Sergey Shoshin
Sergey Shoshin

Reputation: 475

If you are asking only about the apple wallet pass creating process, you need to create some server-side API (like .net core or something similar) that will return bytes array (.pkpass file) with ContentType "application/vnd.apple.pkpass".

Here it is an example.

Interface example:

public async Task<ActionResult<byte[]>> GetAsync()

Return statement example:

return new FileContentResult(pkpassFileFileBytes, "application/vnd.apple.pkpass");

Usually, it is not enough "just return .pkpass file". Usually, you will need to create a system that will manage your passes. Maybe you can just use some services with limited free wallets pass2u, passcreator, passkit, passteam.

Approx parts of Passes management system are:

  1. (Must have) Create passes
  2. (if needed) Delete passes
  3. (if needed) Update data on passes
  4. (Must have) Handler that will at least activates/deactivates pass and update it (if 2 & 3 steps are needed)

Upvotes: 4

Related Questions