问题
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:
- (Must have) Create passes
- (if needed) Delete passes
- (if needed) Update data on passes
- (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