1

I have already created an Apple coupon discountcoupon.pkpass. I uploaded it on my public server and I gave direct download link. When I open that link in my iPhone or iPad, iOS doesn't recognize the pass.

How can I give download link on my website? When the user click in my coupon link, it should show the Wallet add pass screen.

ricardopereira
  • 11,118
  • 5
  • 63
  • 81
M.A
  • 448
  • 6
  • 21

3 Answers3

3

You need to set the MIME type to application/vnd.apple.pkpass for iOS to recognise the file as a pass and to open Wallet.

See this question for how to do that.

Community
  • 1
  • 1
PassKit
  • 12,231
  • 5
  • 57
  • 75
1

Inside the folder where you have your index.html with the download link to the coupon, create a new .htaccess file with this line of code inside:

AddType application/vnd.apple.pkpass    pkpass

then save it and refresh and it will work

-1

Do you have a mac? Try to open the .pkpass file in iOS simulator and read the system log.

You need to understand .pkpass just a "zip file". Although you can zip as a .pkpass file, the content of that passes may not fulfill the requirements of iPhone setting, such cert not valid or pass.json something wrong.

So, try to use iOS simulator and log the error message, it take a easy way for your coming up development

Yuk_dev
  • 318
  • 1
  • 6
  • 16
  • I.pkpass working great when I email or iMessage my question was when I'm trying to auto detect iPhone it's downloading in iPhone but when it's downloading it's shows message in what app u want to open this file. But when I send email or iMessage it shows wallet icon and directly open in wallet and shows add link. – M.A Jan 24 '17 at 01:54
  • @M.A Sorry for my mistake.Try to create a new webpage for download .pkpass, try to use "application/vnd.apple.pkpass" as a HTTP Content Type and header value to be "attachment" – Yuk_dev Jan 24 '17 at 02:24