Closed sharkydeveloping closed 1 year ago
Hi @sharkydeveloping, thanks for using Passkit-generator.
I can guess the error is due to the fact that you are not specifying any pass type through its setter or through pass.json
. Fields getters are meant to crash if no type is available.
Anyway, an issue that for sure you will meet later is that you are passing the certificates paths instead of their contents.
Let me know if this helps!
I will try! Can you help me with an example code please?
@sharkydeveloping take a look here!
Ok, i will have a look! Thanks mate!
Keep me updated on your advancements, so in case we can close the issue :)
Hi!, i got this error Error: Cannot pack passes. Only PKPass instances allowed
var passes: PKPass[] = [];
data.forEach(async (pass_data) => {
const pkpass = await pass(pass_data);
passes.push(pkpass);
});
const passesPacked = PKPass.pack(passes);
when i do this, there is no problem is just when i use an array of data.
const passesPacked = PKPass.pack(pass(data[0]), pass(data[1]));
Update! I figure it out.
const passesPacked = PKPass.pack(...passes);
Glad you solved it! If you could leave a ⭐ on the project, that would be very helpful! Thank you!
Running OS
Windows 10 Version 22H2 for x64-based Systems (KB5029331)
Running Node Version
v20.4.0
Description
I'm trying to create a pkpass.pack(). I tried doing it with pkpass.from(), but there was no result, since it seems it only works with an instance of pkpass. When I try to generate this instance, I get an error that headerFields does not exist, so I don't know what's happening. Perhaps I'm creating the pass instance incorrectly, since I want to create my pass from a template, pass.json.
I'm sending part of the code; thank you in advance.
Code
Function to create the instance of the pass
Function to create the passpack