alexandercerutti / passkit-generator

The easiest way to generate custom Apple Wallet passes in Node.js
MIT License
897 stars 109 forks source link

Opening pass in Google Wallet #220

Closed xtrinch closed 2 months ago

xtrinch commented 2 months ago

So I've successfully generated a pass with this library I can open in Apple Wallet - but not in Google wallet.

I've tried an example pkpass found here: https://github.com/keefmoon/Passbook-Example-Code/blob/master/Pass-Example-Generic/Pass-Example-Generic.pkpass - this one can successfully be imported into Google wallet, but the one I generate with this library (even though I use almost the exact same pass.json) cannot be.

I used this pass.json: https://github.com/keefmoon/Passbook-Example-Code/blob/master/Pass-Example-Generic/Package/pass.json (replacing teamIdentifier and passTypeIdentifier), built the pkpass with this library and am getting "Unsupported file type" within google wallet. Now that error message is so uninformative I don't know where to start. There must be a difference in how pkpass in the example was generated and how this library generates the pkpass.

Any ideas here? Thanks for help

alexandercerutti commented 2 months ago

Hi @xtrinch, thanks for using passkit-generator!

Support of Google Wallet to pkpass is kind of new and I've never had the chance to try it, so I don't know what is going on wrong. I think there might be some unsupported property or perhaps something in the certificates that doesn't let Google Wallet to open the .pkpass files generated with this.

Not sure yet what, but I'm curious if something can be done to support them.

alexandercerutti commented 2 months ago

I don't have an Android, so I cannot test it directly.

this one can successfully be imported into Google wallet, but the one I generate with this library (even though I use almost the exact same pass.json) cannot be.

What are the differences, other than teamIdentifier and passTypeIdentifier? Do these two differ from the signature ones?

Can you open your generated pkpass on an iPhone or you didn't try?

If you didn't try because you don't have an iPhone, you can send it to me (both here or on Telegram) and I can check for you.

xtrinch commented 2 months ago

Yes I've opened it with an iPhone and the pass opens up fine on Apple wallet - so no issues there. The issue is only with google wallet. Other than teamIdentifier and passTypeIdentifier there are no other changes the JSON is completely the same - so this should be easily reproducible by taking the example files and building them with this lib.

The only validator for pkpass I found is https://pkpassvalidator.azurewebsites.net/ and the two pkpasses (the example and mine) tick all the same boxes.

alexandercerutti commented 2 months ago

There must be some subtle nuance that makes a PKPass openable on Apple Wallet rather than Google Wallet...

so this should be easily reproducible by taking the example files and building them with this lib.

Did you try / are you going to try?

xtrinch commented 2 months ago

I don't presume I'm able to since the certificates should match the identifiers?

Now that you mentioned what else should be different - I've swapped out the images for the images in the example repository and it does now open within google wallet - looks like the PNGs I provided were an issue 🤔

alexandercerutti commented 2 months ago

I don't presume I'm able to since the certificates should match the identifiers?

Yes, I guess you are right.

I've swapped out the images for the images in the example repository and it does now open within google wallet

Uh.

Curious.

I wonder if there's a Console.app equivalent for Google Wallet that could give you details like this...

Could you share the images that are NOT working, so perhaps someone can compare them with those in the example? Can you, also, do a test and replace one image per time and check if you can understand which is the picture that doesn't work (if not all of them)?

xtrinch commented 2 months ago

I tried pinning it down a single image but it appears to have something to do with a certain combination of the images and not just one of them, so didn't come to a conclusion at all. I used some random sample images I took from my downloads folder, they were greatly oversized and way too large so I wouldn't necessary spend too much time diagnosing this. I doubt anyone else is going to come into this problem :)

Thanks for the tips and help, closing this issue now

alexandercerutti commented 2 months ago

Okay, perfect! Thanks for your contribution to this topic. I think someone, sooner or later, will face the same problem as yours.

Google Wallet might have some restrictions Apple Wallet doesn't have, I guess.

Btw, if you could leave a ⭐ on the project, that would be awesome!