tschoffelen / php-pkpass

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

Broken with iOS7? #41

Closed jarretth closed 9 years ago

jarretth commented 11 years ago

I notice that http://apps.tomttb.com/pkpass/full_sample does not work on iOS 7. The downloaded pass will load into the iOS simulator, but in Safari I'm getting "Download Failed - Safari cannot download this file.", and in mobile Chrome I'm getting "Sorry, this pass cannot be added to Passbook at this time".

fukuball commented 11 years ago

The same issue happened to me, hope someone to solve this issue.

benbeadle commented 10 years ago

I've also been having issues with iOS 7. I've been working with this framework for a couple months now. I've successfully been able to generate passes and open them on the iOS 6 Simulator, but have not been able to open them via the Mail app in iOS 7.

wayneworks commented 10 years ago

I have the same issue with IOS 7. Passes work with no issues on my Mac. The code I am using to generate the passbooks has been solid for a long time. Please add me to this list so I get notified when an update is available.

benbeadle commented 10 years ago

@All: I thought I'd come back and update my findings. I found a pretty simple function that generates passes - and it works on iOS 7! Thought it might be useful for the time being since PHP PKPass isn't working.

https://github.com/SimonWaldherr/passkit.php/blob/master/passkit.php

fukuball commented 10 years ago

@benbeadle I tried https://github.com/SimonWaldherr/passkit.php/blob/master/passkit.php , and the demo still can't works in iOS7(but works in iOS6), I even try to run on my server, https://github.com/SimonWaldherr/passkit.php/blob/master/passkit.php , the demo on my server can't works both in iOS6 and iOS7, but the same Cert in tschoffelen/PHP-PKPass on my server works in iOS6 not works in iOS7 https://stage.indievox.com/api/tool/download/eticket?entry_code=d252349f1eb88e50ffb54e73367b2c66 , really wired.

fukuball commented 10 years ago

I update my cert, and can run tschoffelen/PHP-PKPass demo both in iOS6 and iOS7! Still need to confirm what cause this issue.

nutickets-damon commented 10 years ago

Which certificate did you update fukuball? We've just noticed the same issue with PKPass!

mastermind4242 commented 10 years ago

Please some one help

Which certificate did you update fukuball?

i am also having same issue.

Please some one tell what changes i need to do.

for ios7

fukuball commented 10 years ago

Dear All,

sorry for late, I just follow the readme doc and recreate the cert.

  1. Requesting the Pass Certificate
  2. Getting the example.php sample to work

And the example works! I have no idea what I've done Just try the step again.

arronzhang commented 10 years ago

Check the fields key for duplicate, It can't allow duplicate in iOS 7 but will ignore in iOS 6.

KringoBongo commented 10 years ago

Also make sure that the serialnumber is not entirely numeric, as it needs to be a string, I got this error : Value for key 'serialNumber' must be of class NSString, but is actually of class __NSCFNumber.

dacapoapps commented 10 years ago

This is not broken! IOS7 added a few more validation rules and rejects the pass if it fails validation. Unfortunately the pass validation is not the same everywhere, so being able to email yourself a pass in your MAC does not mean it is valid. The best way to check is to use the iOS simulator, save the PKPass or export it to message then drag the file into the simulator, you need to have the console open to look at the logs and it will tell you exactly what is wrong with your pass. Moving forward though this example lacks the DB interfaces required to allow you to dynamically update the pass or revoke it as required.

ghost commented 9 years ago

Same issue here, but nothing is showing when I tail system.log after dragging a pass file into the simulator. Any suggestions?

jarretth commented 9 years ago

Two suggestions:

  1. Make sure you're using a valid certificate. The one in the sample, if it's still generating invalid passes, is likely expired
  2. As suggested, the iOS Simulator's console output(Debug > Open System Log / cmd+/) should give you all you need to know about pass formatting issues. The most common issue I run into is my application putting null in the json where a value is required(ie, the "value" index of a field dictionary).

The sample's error output is:

Jul 27 17:03:26 j.local MobileSafari[96561]:  SecTrustEvaluate  [leaf ValidLeaf]
Jul 27 17:03:26 j.local MobileSafari[96561]: Invalid data error reading pass pass.nl.mijnbc.test/123456. The passTypeIdentifier or teamIdentifier provided may not match your certificate, or the certificate trust chain could not be verified.
Jul 27 17:03:26 j.local MobileSafari[96561]: PassBook Pass download failed: The pass cannot be read because it isn’t valid.

Note that the OSX passbook loader is much more lenient than iOS's, so using the simulator is important.

As I can verify that the library is still working as expected for all current versions of iOS, I am closing this issue.

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.