tschoffelen / php-pkpass

💳 PHP class for creating passes for Wallet on iOS.
https://includable.com
MIT License
908 stars 187 forks source link

Passes are not showing in Pass format in iPhone if WWDR Cert Path is added #16

Closed newtoios closed 11 years ago

newtoios commented 11 years ago

I followed the steps to add WWDR Cert Path in my index.php and PKPass.php files. After adding, the pass is not showing in Pass format in my iPhone to add it as a pass in passbook. If i'm commenting this line in index.php, the Pass format is coming but not adding into Passbook. Please help.

ptz0n commented 11 years ago

Please see my response to issue #12.

Did you get the Passbook preview screen with the Add pass button in the upper right corner?

Please verify that you have set your correct passTypeIdentifier and teamIdentifier.

newtoios commented 11 years ago

Yes, i can able to see the Add pass button in the upper right corner, and also i have updated the passTypeIdentifier and teamIdentifier values correctly.

The problem is with the "$pass->setWWDRcertPath('supportfiles/AppleWWDR.pem');" new line.

If i'm giving this reference, i can able to generate the pass, but its not showing as a pass in the iPhone.

If i'm hiding this line and generating the pass, i can see the Pass and Add pass button in the upper right corner. But unable to add it into the passbook if i'm pressing the blue Add pass button.

I have modified my code with

with

if(!$pass->create(true)) { // Create and output the PKPass echo 'Error: '.$pass->getError(); }


I'm actually converted the p12 and pem files by using windows 7 OpenSSL command lines and added the reference in my code files. Do you think this might be the problem?

newtoios commented 11 years ago

I have tested it again, if I'm giving reference to setWWDRcertPath('......'); its not creating as Pass.

ptz0n commented 11 years ago

Passbook require that you have signed with WWDR-cert. Please provide the steps describing how you converted the cert in Win 7.

tschoffelen commented 11 years ago

As @ptz0n assumes, it might have to do with the converting. Try validating the certificate using the command line OpenSSL tools.

tschoffelen commented 11 years ago

Or try using the certificate on my server: http://apps.tomttb.com/AppleWWDRCA.pem

newtoios commented 11 years ago

I simply downloaded the Apple WWDR-cert from this link "http://developer.apple.com/certificationauthority/AppleWWDRCA.cer" and converted to pem by following the below steps in Command Prompt.

  1. Copy the AppleWWDRCA.cer file into your OpenSSL location which is installed in your Windows 7
  2. Execute this command "openssl x509 -inform der -in AppleWWDRCA.cer -out AppleWWDRCA.pem"

And this AppleWWDRCA.pem file reference i'm giving in setWWDRcertPath('......'); method.

Please let me know if you need more clarifications on this.

newtoios commented 11 years ago

@tschoffelen, I'm unable to download your certificate on http://apps.tomttb.com/AppleWWDRCA.pem

tschoffelen commented 11 years ago

Whay can't you download it?

rachidk commented 11 years ago

Hi, I have the same pb. I'am able to generate a pkpass with the example.php I send it by email. When I open it with my email application in IOS6 it detect it as a pass with the good informations . The problem is when I click in add it doesnt add it to passbook. When i open passbook it doesnt show it. I download you ceritficate http://apps.tomttb.com/AppleWWDRCA.pem but doent work. I tried with other pass in passsource and it works, i see them in passbook appli.

Can someone help me .

ptz0n commented 11 years ago

Does your log tell you anything? Need more to go on. Please go through each step in the readme on how the get the example working.

rachidk commented 11 years ago

Hi ,

It was a certificate problem. I solved it. Thank you.

ptz0n commented 11 years ago

Perfect, good job!

Shalling commented 11 years ago

Got a same problem here, I tried to solve it by download your certificate and download a new certificate for my pass but still got the same problem.

KREUZc commented 11 years ago

I got same problem here. I read whole example.php and pkpass.php code, DL newest version, change server certifications, try/catch in each line, check all file/parameters' name, get /tmp/ file to debug, but useless. Really need some help.

It always get a pass.pkpass with an empty signature(file_put_contents is work, I can send other string in), but OpenSSL Command Line makes signature well with the same .p12 and wwdr.pem files.

The problem is: "openssl_pkcs7_sign($paths['manifest'], $paths['signature'], $certdata, $privkey, array(), PKCS7_BINARY | PKCS7_DETACHED, $this->WWDRcertPath);" in PKPass.php(Line:323) didn't work and no error message.

and Merry Christmas!

lock[bot] commented 6 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.