-
Notifications
You must be signed in to change notification settings - Fork 34
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
Failed to add pass error #7
Comments
If you extract the generated pkpass file (it's just a signed zip file) are all the files from the template folder present? are the files named and placed as per the Apple documentation?. This library doesn't actually check that the files in the folder are correctly named. |
@alvinbaena Don't see the option to unzip the file. Is it possible to unzip without installing 3rd party software? |
Sure, you'd have to do it via the terminal with the |
That is indeed weird. Does the same behaviour happen if you try to open the pass on a real device? |
Same result |
Sorry for the late response, I've been a bit busy. Please try following the new example provided by a community member, and see if the error changes or goes away: c := passkit.NewBoardingPass(passkit.TransitTypeAir)
// Utility functions for adding fields to a pass
c.AddHeaderField(passkit.Field{
Key: "your_head_key",
Label: "your_displayable_head_label",
Value:"value",
})
c.AddPrimaryFields(passkit.Field{
Key: "your_prim_key",
Label: "your_displayable_prim_label",
Value:"value",
})
c.AddSecondaryFields(passkit.Field{
Key: "your_sec_key",
Label: "your_displayable_sec_label",
Value:"value",
})
c.AddAuxiliaryFields(passkit.Field{
Key: "your_aux_key",
Label: "your_displayable_aux_label",
Value:"value",
})
c.AddBackFields(passkit.Field{
Key: "your_back_key",
Label: "your_displayable_back_label",
Value:"value",
})
pass := passkit.Pass{
FormatVersion: 1,
TeamIdentifier: "TEAMID",
PassTypeIdentifier: "pass.type.id",
AuthenticationToken: "123141lkjdasj12314",
OrganizationName: "Your Organization",
SerialNumber: "1234",
Description: "test",
BoardingPass: c,
Barcodes: []passkit.Barcode{
{
Format: passkit.BarcodeFormatPDF417,
Message: "1312312312312312312312312312",
MessageEncoding: "utf-8",
},
},
} |
Upon generating the .pkpass from the file template, the iOS Simulator throws the following error instead of loading the pass:
I've used the code from the README to generate the .pkpass:
No certificate errors are being thrown, so I think it's safe to say it's not related to certificates/signing.
I'm using the the Generic.pass from Apple as a template, and replaced the values of the JSON with the above fields. I also printed the contents of the pass.json after it was loaded into memory and all the fields were filled out as they were supposed to be, but I still get this error.
The text was updated successfully, but these errors were encountered: