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

丶灬走出姿态 提交于 2021-02-10 18:33:15

问题


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.


回答1:


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)


来源:https://stackoverflow.com/questions/58626074/how-to-create-pkpass-file-for-apple-wallet-on-serverside-and-get-it-on-ios-side

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!