The Easiest Way to Get a URL for your Apple Wallet Passkit Pass

For try! Swift NYC, we are playing with the idea of adding QR codes to conference badges that will add attendee’s contact information business card to your Wallet app. It is easy to generate a QR code from a URL. And it is relatively easy to create a PassKit Pass – it’s basically just a bunch of files in a folder. But I was super confused on that step in-between – how do I create a link from the final Passkit .pkpass file…

The Distributing Passes instructions include the following information about this:

So what the hell is a MIME type?!!! I have no idea. But googling around for it, I learned that I couldn’t set it for my jekyll website. I needed another solution!

So after the initial panic and confusion, I took a breath and stepped back. I realized that .pkpass is simply a file. All that was needed was a link to this file (and that MIME type thing, but I chose to ignore it at that moment). Immediately, my thoughts went to Amazon Services, with S3 as the perfect file storage solution.

So I signed-in and created the tryswiftpasskit bucket. I set the location to US East (N. Virginia), since the conference would take place in New York, so that’s the closest.

I went through the rest of the bucket creation process and finished. I then went inside my bucket and clicked the Upload button. I downloaded the Sample Passes listed in their tutorial, so I had one ready to test!

I set the permissions to public, since the link has to be public in order to get the .pkpass file to download into the Wallet app:

And now the magical part… remember that whole MIME type thing?!! From googling around, I figured out enough to set is as the Content-Type property on the file:

It should be set to application/vnd.apple.pkpass. Save and finish and you’re ready to go!

The final step is to get that link. Click into the object in your bucket, and you’ll see it right there for you:

That’s it! Open that link in Safari or via the Mail app (or generate a QR Code) and you’ll see the pass 💃🏻

Enjoy the article? Join over 17,500+ Swift developers and enthusiasts who get my weekly updates.

  • Jeremy Pereira

    I can’t get past the idea that you didn’t know what a MIME type is. Is it that you didn’t know how a web browser or mail client knows what kind of thing it has just downloaded or is it just that you didn’t know the proper name for what you put in the content-type header (e.g. text/html is a MIME type)?

    • I don’t know the exact terminology for everything… Nothing wrong with not knowing every single term and detail. I can make a website, figure things out, and learn. That’s a more important skill IMO.

      • Jeremy Pereira

        I agree with everything you say, but if you have been making web sites for a while, it really surprises me you have never come across the term before, that’s all.

        • That part usually comes inside a framework and doesn’t need much configuring. If it does, it’s usually enough to copy / paste. Assuming everyone knows everything you know is why development is harder than it really is. A lot of these tutorials miss the basics for a lot of people who need them.