tschoffelen / php-pkpass

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

I'm getting PKPasses of size 0Kb #53

Closed prathammehta closed 8 years ago

prathammehta commented 8 years ago

I've followed all the steps in the readme to get the example.php working. I've added all the certificates correctly as far as I can tell. I'm hosting the whole thing on localhost. Is this a problem?

When I access it on the iPhone it says file cannot be downloaded and when I click on it on my mac, it says the file cannot be opened.

Any advice would be great. Thanks!

tschoffelen commented 8 years ago

Getting a pass file of a size of 0kb probably means that the Zip compression fails. Please check if you have the zip extension installed and it is active on your system.

prathammehta commented 8 years ago

Alright. I'll do that. Thanks :)

prathammehta commented 8 years ago

screen shot 2016-06-28 at 2 14 42 pm It shows up in the phpinfo(). Do you think it's still this that's causing the issue?

tschoffelen commented 8 years ago

Okay, that makes it a little less likely that is the problem. Can you try adding the following two lines at the top of the example code and see if it outputs any errors?

ini_set('display_errors',1);
error_reporting(E_ALL);
prathammehta commented 8 years ago

Just tried it. No difference. No errors. Just spits out the same empty file. :/ Any clues as to what else it could be? Do I need to run it on a https host for it to work?

tschoffelen commented 8 years ago

HTTPS is not necessary for only downloading the pass, only for downloading it on an iDevice. I honestly don't have any other ideas, other than trying to test the ZIPArchive library standalone and looking if it works then. It works on my mac with the default settings, so not sure what's causing this.

pkoetter commented 8 years ago

Hey, I have had the same problem. To solve this you either have to print the variable "$file" from "PKpass.php" at the end of the function "create" or print the return value of that function in the example.php wich is probably the better idea.

prathammehta commented 8 years ago

Gonna go try this right away! Thanks :D

prathammehta commented 8 years ago

This worked perfectly! Thank you so much! :D

Just added a "echo $file" before the return statement in the create() function.

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.