tschoffelen / php-pkpass

đź’ł PHP class for creating passes for Wallet on iOS.
https://includable.com
MIT License
913 stars 188 forks source link

Passes not adding to Passbook #12

Closed 128keaton closed 12 years ago

128keaton commented 12 years ago

Whenever I generate a pass and I tap add, it disappears instead of showing the adding animation. I checked my book and it doesn't show. I even tried your example online and that doesn't work either.

ptz0n commented 12 years ago

This happens when the Pass is invalidated by Passbook.

Have you followed all the steps in README.md; added the correct certificates, passTypeIdentifier and teamIndentifier or modified the example in any way?

You can check your iPhone log (in Xcode) or use the PHP PKValidate class.

PS. Did you solve the issue with this commit? DS.

javipagan commented 12 years ago

I have the same problem. The pass is loaded fine but not saved in passbook. Your example online has the same problem.

ptz0n commented 12 years ago

I may be able to help if you answer my questions above.

javipagan commented 12 years ago

Solved, problem was in $pass->setWWDRcertPath('AppleWWDRCA.pem'); The version of PKPass.php that I had downloaded didn't have this property. Thanks

ptz0n commented 12 years ago

Great & good job! The method setWWDRcertPath was recently added in a pull request.

@tschoffelen closing this one?

newtoios commented 12 years ago

I'm referring to the starbucks_example and still facing the same problem. i given the reference to AppleWWDRCA.pem and generated the pass. when im trying to open it in my iphone, its not showing as pass. can you help me?

ptz0n commented 12 years ago

Hi newtoios,

The Starbucks sample lacks error output. Try edit index.php and replace (line 65)

$pass->create(true); // Create and output the PKPass

with

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

i have the same problem, too. I use the newest version of php-pkpass and did every step from the readme, but i can't add passes to passbook. In the console i see this warning: "Invalid data error reading card passTypeIdentifier / serialNumber. Manifest signature did not verify successfully" any ideas, how i can get it work?

ptz0n commented 12 years ago

@SimonWaldherr Are you referring to starbucks_sample/index.php or example.php?

Are you sure the passTypeIdentifierand serialNumber keys are entered correctly?

SimonWaldherr commented 12 years ago

I have this warning on all examples full_sample, starbucks_sample and example.php. passTypeIdentifier is entered as in iOS Provisioning Portal / Pass Type IDs overview.
I think, there was a misunderstanding, the console warning was: passd[6139] <Warning>: Invalid data error reading card pass.com.weventa.demo/980425-104-660. Manifest signature did not verify successfully

For test purposes, i deleted the $this->clean(); lines and discovered that the signature file is empty.

Shalling commented 11 years ago

Got a same problem here. Certificated and WWDR verified. and changed the passTypeIdentifier as well as teamIdentifier, but still not fix. Using PKValidate checking json file but it show no error. Here is sample of json. Where $passTypeIdentifier, $teamIdentifier, $authToken are variable

{ "description":"Business card, powered by Sirimedia Co,Ltd.", "formatVersion":1, "organizationName":"Sirimedia Co, Ltd.", "passTypeIdentifier": $passTypeIdentifier, "serialNumber":"50a5b7484ae9c", "teamIdentifier": $teamIdentifier, "generic":{ "headerFields":[], "primaryFields":[{ "key":"name", "label":"Name", "value":"Phakphum Visetnut", "textAlignment":"PKTextAlignmentLeft" }], "secondaryFields":[{ "key":"phone", "label":"", "value":"", "textAlignment":"PKTextAlignmentLeft" },{ "key":"position", "label":"", "value":"", "textAlignment":"PKTextAlignmentRight" }], "auxiliaryFields":[{ "key":"email", "label":"", "value":"", "textAlignment":"PKTextAlignmentLeft" }], "backFields":[{ "key":"address", "label":"", "value":"", "textAlignment":"PKTextAlignmentLeft" }] }, "barcode":{ "format":"PKBarcodeFormatQR", "message":"BEGIN:VCARD\nN:Phakphum Visetnut;\nADR:\nEMAIL:\nTEL:\nTITLE:\nEND:VCARD\n", "messageEncoding":"iso-8859-1", "altText":"" }, "backgroundColor":"rgb(240,240,240)", "logoText":"Sirimedia", "webServiceURL":"", "authenticationToken": $authToken }

tschoffelen commented 11 years ago

Try the example at http://apps.tomttb.com/pkpass/example.php. Does that one work on your iPhone?

ptz0n commented 11 years ago

Hand-written JSON can be hard, I see several errors;

Please get the latest version of the example file. Using the PHP data format that then encodes into JSON is more fail-safe.

kaurharpreet commented 10 years ago

i got downloaded file but the file is not opened in IOS .....it display error (The pass “pass.pkpass” could not be opened.)

ptz0n commented 10 years ago

@kaurharpreet What do the logs tell you?

kaurharpreet commented 10 years ago

openssl_x509_read() [function.openssl-x509-read]: supplied parameter cannot be coerced into an X509 certificate! openssl_pkcs7_sign() [function.openssl-pkcs7-sign]: error getting cert in file_get_contents(/tmp/PKPass5371f96a521c41.79777861/signature) [function.file-get-contents]: failed to open stream: No such file or directory

this error is displayed in .pass file

ptz0n commented 10 years ago

@kaurharpreet Looks like a problem with the cert. Have it worked before?

kaurharpreet commented 10 years ago

no it didn't work..

ptz0n commented 10 years ago

@kaurharpreet Then please double check your certificate. Follow the instructions here: https://github.com/tschoffelen/PHP-PKPass#requesting-the-pass-certificate

kaurharpreet commented 10 years ago

i create the certificate again ..it works now...thank u for your help

himanshu4994 commented 8 years ago

used example.php and Pkpass.php from https://github.com/tschoffelen/PHP-PKPass and getting an error openssl_pkcs7_sign(): error opening the file, WWDR.pem in C:/xampp/htdocs/PkPass.php on line *** Please help resolve it

tschoffelen commented 8 years ago

Hi! Sounds like that file is missing, have you downloaded it? See the instructions in the README of this repo, specifically concerning the WWDR intermediate certificate.

himanshu4994 commented 8 years ago

Sir i am sure that i have the file in there............downloaded the certificate from apple developer site and then extracted it from the keychain

himanshu4994 commented 8 years ago

moreover , an invalid pkpass file is also getting generated

rajud521 commented 6 years ago

unable to add this file cannot be added to passbook(wallet). above error is showing, how to solve this.

rajud521 commented 6 years ago

Hi i am getting this error: Warning: openssl_pkcs7_sign(): error opening the file, ../certificates/AppleWorldwideDeveloperRelationsCertificationAuthority.pem in E:\xampp\htdocs\passbox_1\PKPass\PKPass.php on line 317

please how to remove above error.

tschoffelen commented 6 years ago

@rajud521 Did you overwrite the wwdrCertPath? Because that's indeed not the correct filename. You shouldn't need to change that, since there's a version of that certificate shipped alongside the library: https://github.com/tschoffelen/php-pkpass/blob/master/src/PKPass.php#L104

Also, please open a new issue of this problem persists without your code customisation, since it's not related to this already-closed issue.

rajud521 commented 6 years ago

@tschoffelen, it is working fine in Android phone, but it is showing in Apple IPhone that "unable to add this file cannot be added to passbook" So, please how to remove this error.

tschoffelen commented 6 years ago

@rajud521 That is because Android doesn’t check if the pass certificate is valid. See the Debugging section in the Readme to figure out what’s going wrong exactly.

rajud521 commented 6 years ago

again created the certificate, it is working fine now. Thank you!

lock[bot] commented 5 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.