Apparently Mountain Lion 10.8.2 Safari "supports" Passbook passes, in that it will preview and offer to sync ".pkpass" files to iCloud for the user's configured iPhone to load into Passbook.
However, I haven't found any documentation on how to get the browser to load such a file, other than the user explicitly downloading such a file.
Ideally, there would be a <link rel="alternate" type="application/vnd.apple.pkpass">
or similar tag so a supporting (and suitably configured) browser could pick it up and offer it. I can't find any mention of such a feature.
Other than that, the user would need to be directed to "click here" to download a pkpass and hope to heck they knew what it was and what to do with it. Otherwise, it's an opaque blob in their Download folder.
Obviously I don't want to be explicitly sniffing the User-agent for iOS 6 or OS X 10.8.2 and above, as this would not also check if the user had iCloud configured, and also precludes support for PassWallet and similar apps for Android and the like, along with other supporting browsers.
Your iDevice will then allow you to add the PKPASS file to your Apple Wallet, where the file will appear as a pass. Android users can use Above Mobile Limited PassWallet to open and manage PKPASS files on their Android devices.
PKPASS is a file format, used for storage and exchange of digital passes, developed by Apple for its Wallet application. It's intended to represent information that "might otherwise be printed on small pieces of paper or plastic" like boarding passes, membership cards, coupons, certificates, etc.
The obvious solution is to include an Accept header for the vnd.apple.pkpass content type. This is precisely the intention of this header.
That's not in the hands of an individual developer unfortunately.
Microsoft do this for the .Net Framework where they send the information as part of the User-Agent. This lets you detect if the .Net Framework is installed on the visitor's machine.
OS X Lion should include this header in all browser requests issued and iOS devices should send it too.
At present, the best option you would have is the one you've outlined. If the UserAgent is for iOS or OS X Lion you can infer support. It's not ideal, but the best you can do at present.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With