How can I add pass to apple wallet after generating it from my web application #127
-
I intend of generating a pass for a purchased event ticket of my platform. I plan on generating a new pass for the user whenever they click on the paid event ticket in the tickets page. So my question here is; after I successfully generate the pass from my web application, how can I add a button for the user to add the recently generated pass to their wallets so they don't have to come back to the web app when they're about to redeem the pass? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hi @mbappai, thanks for using passkit-generator! It is not very clear in which context you are, but I assume you are using it on Safari iOS. The general rule is to show a button "Add to Apple Wallet" (check for iOS HIG for all the details) when the user lands on the tickets page. Once the button is clicked, you should ping the server, generate the pass and serve it back. You can safely use an It is not required to have a button "Add to Apple Wallet". I mean, it is better because you can let the user choose what to do and not receive an unexpected ticket-adding request (not everyone might know what Apple Wallet is and where to find it). I'm saying this because, if you are in a same-origin context, you can think to make something like this with Javascript: Object.assign(document.createElement("a"), {
href: <your server url>,
download: "file-name.pkpass",
}).click(); And it will automatically download the pass and show the Safari I hope I've been able to answer your doubt. If not, may you give me more details, please? |
Beta Was this translation helpful? Give feedback.
Hi @mbappai, thanks for using passkit-generator!
It is not very clear in which context you are, but I assume you are using it on Safari iOS.
The general rule is to show a button "Add to Apple Wallet" (check for iOS HIG for all the details) when the user lands on the tickets page. Once the button is clicked, you should ping the server, generate the pass and serve it back. You can safely use an
HTMLAnchorElement
withdownload
attribute to request for pass downloading.It is not required to have a button "Add to Apple Wallet". I mean, it is better because you can let the user choose what to do and not receive an unexpected ticket-adding request (not everyone might know what Apple Wallet is a…