-
Notifications
You must be signed in to change notification settings - Fork 14
Add to Passbook
#Add to Passbook A user can add a pass to passbook using two different methods.
- By being redirected to your passkit loading page
- By scanning a QR in the Passbook app that redirects to your passkit loading page
The second method is a bit more work to implement, as you likely want your user to just be able to scan the same QR code that is show on your pass. To implement this method you need add the following PHP code to the address the QR code sends users.
if (strstr($_SERVER['HTTP_USER_AGENT'], 'Passbook')) {
header('Location: /passkit/?id='.$_GET['id']); //redirect to the passkit loading page when the Passbook user agent is detected
} else {
//This is where you would add the code for the default action of the QR code
}
###I get an a message that says "Unable to Download" when I try to add my pass! This could either be a certificate issue, a mime-type issue with your server, or you may be trying to load the passkit loading page within an instance of UIWebView. If you are trying to add the pass from a home screen webapp, you need to open the passkit loading page in Safari. Alternatively the issue could be that your QR reading app is trying to use an embedded version of Safari (UIWebView) to load the page - which, unfortunately, does not work.