Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected "register: true" when creating pass #6

Closed
drallgood opened this issue Oct 27, 2012 · 3 comments
Closed

Unexpected "register: true" when creating pass #6

drallgood opened this issue Oct 27, 2012 · 3 comments
Labels
Milestone

Comments

@drallgood
Copy link
Owner

Reported by hnthuan:

There is one problem with Barcode when create file pkpass.
When I call function setMessageEncoding( Charset.forName( "utf-8" ) ),I receive a string {"register":"true"} in file pass.json, so PassBook can't read file pkpass.
I fix this by edit your code, reply Charset by String, rebuild project and create new pkpass file that PassBook read successfully.
I'm not sure the message will be encode to UTF-8, so I hope you can check this bug for everyone can use your code more easy.

@hnthuan
Copy link

hnthuan commented Oct 27, 2012

When I use your code:

barcode.setFormat( PKBarcodeFormat.PKBarcodeFormatQR );
barcode.setMessage( "ABCDEFG" );
barcode.setMessageEncoding( Charset.forName( "utf-8" ) );

In pass.json file,I get the string:

..., "barcode":{"format":"PKBarcodeFormatQR","message":"ABCDEFG","messageEncoding":{"registered":true}}, ...

PassBook can't read pkpass file created with this string.

After update code, I'm using:

//barcode
barcode.setFormat( PKBarcodeFormat.PKBarcodeFormatQR );
barcode.setMessage( "ABCDEFG" );
barcode.setMessageEncoding( "UTF-8" );

And in pass.json file, I get the string:

...,"barcode":{"format":"PKBarcodeFormatQR","message":"ABCDEFG","messageEncoding":"UTF-8"},...

PassBook load pkpass file and read successful.

Is this help?

@drallgood
Copy link
Owner Author

Hmm... Strange. This exact code is working fine when I execute it.
Which exact version of jPasskit are you using?

Changing it from java.nio.charset.Charset to a string is not an option as I want to use as many common java classes as possible.

@drallgood
Copy link
Owner Author

Looks like Jackson isn't serializing the Charset class correctly.
I've tried to fix it by filtering all fields except the name attribute.

@drallgood drallgood removed their assignment Jun 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants