Open lol768 opened 2 years ago
@lol768 @tomasmcguinness
my .pkpass is generating but here are 2 problem
I am currently facing an issue like I have created a .pkpass file from the code and when I am trying to open that file in Apple device I am getting a "File not supported issue" but If I open the same pass in android (PassWallet or Passes) it works fine.
I want to set 2 fields in a row and 3 rows with same & 1 row with 3 fields. Please help me
PassGenerator generator = new PassGenerator();
PassGeneratorRequest request = new PassGeneratorRequest();
request.PassTypeIdentifier = "xxxxxxxxxxxxxxxxxxxx";
request.TeamIdentifier = "xxxxxxxxxxx";
request.SerialNumber = Guid.NewGuid().ToString("N"); ;
request.Description = "test desc";
request.OrganizationName = "test org";
request.LogoText = "logo text";
request.BackgroundColor = "#19342f";
request.LabelColor = "#19342f";
request.ForegroundColor = "#FFFFFF";
request.AppleWWDRCACertificate = new X509Certificate2(Server.MapPath("~/Certificate/fffff.cer"));
request.PassbookCertificate = new X509Certificate2(Server.MapPath("~/Certificate/fffff.pfx"), "ffffff");
request.Images.Add(PassbookImage.Icon, System.IO.File.ReadAllBytes(Server.MapPath("~/Icons/icon.png")));
request.Images.Add(PassbookImage.Icon2X, System.IO.File.ReadAllBytes(Server.MapPath("~/Icons/icon@2x.png")));
request.Images.Add(PassbookImage.Icon3X, System.IO.File.ReadAllBytes(Server.MapPath("~/Icons/icon@2x.png")));
request.Images.Add(PassbookImage.Logo, System.IO.File.ReadAllBytes(Server.MapPath("~/Icons/logo.png")));
request.Images.Add(PassbookImage.Logo2X, System.IO.File.ReadAllBytes(Server.MapPath("~/Icons/logo@2x.png")));
request.Images.Add(PassbookImage.Logo3X, System.IO.File.ReadAllBytes(Server.MapPath("~/Icons/logo@2x.png")));
request.Style = PassStyle.Generic;
request.AddPrimaryField(new StandardField("org name", "1991 Mountain Boulevard Oakland, Ca", "Walmart Pharmacy","TestAttr",DataDetectorTypes.PKDataDetectorTypeAddress));
request.AddSecondaryField(new StandardField("rfv", "ft", "234"));
request.AddSecondaryField(new StandardField("rfc", "fg", "rdd"));
request.AddSecondaryField(new StandardField("rfx", "fb", "wer54"));
request.LogoText = "Prescription Discount card";
byte[] generatedPass = generator.Generate(request);
return File(generatedPass, "application/vnd.apple.pkpass", request.SerialNumber+".pkpass");
Hi,
If the pass won't open, it's most likely failing validation. Ensure your pass type identifier and team identifier match.
Also ensure your certificates are valid.
As for the column/row issue, I don't think it's possible.
Tom
@tomasmcguinness
I've double checked and pass type identifier
and team identifier
match properly
Once using your validate option, getting below
Please help me where & what is the issue so that I can go ahead.