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

Color Validation #21

Open
bencurthoys opened this issue Mar 7, 2024 · 0 comments
Open

Color Validation #21

bencurthoys opened this issue Mar 7, 2024 · 0 comments

Comments

@bencurthoys
Copy link

bencurthoys commented Mar 7, 2024

I just had a pkpass file not work for me in a very annoying way, and eventually I tracked it down to the colour.

My pass generation code used the Name property of a System.Drawing.Color object to set PassGeneratorRequest.BackgroundColor, LabelColor, and ForegroundColor, which worked when the Color object was a custom colour and the name property was the hex representation of the colour, but when it was the constant System.Drawing.Color.Black, and the json looked like this:

image

it just stopped working with the usual "Safari is unable to open this file" message.

I eventually managed to dig out of the log file the error:

Mar 7 14:19:15 iPhone MobileSafari(PassKitCore)[30760] : Invalid data error reading pass pass.com.monadticketing/b6688f74-f0ad-407f-b5f6-61a829fa7731. Unable to parse color string 'Black'.
Mar 7 14:19:15 iPhone MobileSafari(MobileSafariUI)[30760] : PassBook Pass download failed: Error Domain=PKPassKitErrorDomain Code=1 "(null)"

Would you like me to add to this tool validation of the values of the color fields, and submit a pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant