ligi / PassAndroid

Android App to view passes
GNU General Public License v3.0
821 stars 134 forks source link

Linear barcodes #43

Closed Riotism closed 8 years ago

Riotism commented 8 years ago

Please add support for linear barcodes. There are royalty cards that use them.

ligi commented 8 years ago

Thanks for the suggestion - are you able to provide me with a royalty card that uses such a code?

Riotism commented 8 years ago

Nectar card, Carrefour bonus cards, Barnes & Noble club card, various college library cards and gym membership cards, etc.

ligi commented 8 years ago

thanks for the info! But I mean I would need such a card as a file ( can treat it confidentially ) to see how these codes are referenced in the json - If you do not want to share the whole pass it would be also OK to just extract me the barcode part of this pass

ligi commented 8 years ago

wikipedia indicates code128 was added with iOS9: https://en.wikipedia.org/wiki/Wallet_(application) - I could try to implement by guessing but It would be better to have a sample pass to verify my assumptions

friedger commented 8 years ago

I created one with https://create.passkit.com/

This is the json for he barcodes part: "barcodes":[{"format":"PKBarcodeFormatCode128","message":"https://p.pass.is/1mxwkvtF0hsW5shN/1899083311081098","messageEncoding":"UTF-8","altText":"2a8QpwcBA9Br"},{"format":"PKBarcodeFormatAztec","message":"https://p.pass.is/1mxwkvtF0hsW5shN/1899083311081098","messageEncoding":"UTF-8","altText":"2a8QpwcBA9Br"}]

ligi commented 8 years ago

thanks - but this is AZTEC which is a currently supported 2D barcode

friedger commented 8 years ago

PKBarcodeFormatCode128 ?

ligi commented 8 years ago

Ah this one has 2 barcodes - just parsed the second one not the first - thanks!

friedger commented 8 years ago

Documentation says that a fallback is required for Code 128 on devices with iOS8, hence the two barcodes.

Riotism commented 8 years ago

I also have cards that use code 93, but I don't think Wallet supports it at all. Is it possible to implement it?

ligi commented 8 years ago

ZXing ( the lib to encode barcodes ) only supports code128 and code39 - I have a branch that supports reading ( not editing ) both now - will merge it in the next version

ligi commented 8 years ago

There is now 1D BarCode support in 2.6.2 ( released as beta ) - thanks for all your input