13
Views
1
Comments
Solved
[PassSharp] Image, Barcode and Label Color Issues
Question
passsharp
Reactive icon
Forge asset by flpmorais
Application Type
Service

Hello team,

I'm encountering some challenges while using the PassSharp Forge component for generating pkpass files, specifically related to image, barcode and label color functionalities. Here are the issues I'm facing:

  1. Hero Image (strip) issue: despite adding the image to the "strip" field, that image isn't being displayed on the pass;
  2. Barcode display issue and pass crashing: when configuring the barcode, according to the documentation of the component, I'm not able to open the pass (it crashes). I suspect there might inconsistencies between the component and what's defined in the Apple documentation (https://developer.apple.com/documentation/walletpasses/pass/barcodes). I've tried defining both alternatives, "barcode" object (deprecated according to the Apple documentation) and also "barcodes" object, but without success.
  3. Label color not applied: although I've defined the label color as white ("rgb(255, 255, 255)"), it's appearing as black in the generated pass (in the "pass.json" file, the "labelColor" field is missing).

Here is the "pass.json" file that is being generated by the component (you can also see the organization of the .zip file, with all the required files to build a pass).

I've thorougly reviewed the documentation and attempted various troubleshooting steps, but I haven't been able to resolve these issues. Any insights, suggestions, or experiences with similar challenges would be greatly appreciated.

Thank you in advance for your help!

2022-04-21 15-28-18
João Matias
Solution

Hi again,

I've managed to solve all the issues (with the help of Luís Oliveira).

Solution:

  1. Hero Image (strip) issue - I was generating a "generic" pass style. I've checked on the Apple pass creation documentation (https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/PassKit_PG/Creating.html), which mentions that the strip image isn't supported for a generic pass style. To solve this issue, I changed the pass style to "event ticket".
  2. Barcode display issue and pass crashing - I wasn't passing the right values on the right fields (due to the inconsistency between the component barcode field descriptions and what's defined in the Apple documentation). After lots of tests, I was able to display the barcode (the barcode values should be assigned on the "Barcode" object, instead of the "Barcodes" object list). Also, Luís has fixed the descriptions of the barcode object fields (now they are matching the description on the Apple documentation).
  3. Label color not applied - there was a missing assign. It's working properly now.
Thank you again Luís, I hope this helps other people that faced similar issues related to this component.
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.