pkpassvalidator icon indicating copy to clipboard operation
pkpassvalidator copied to clipboard

pkpasses support

Open lol768 opened this issue 2 years ago • 3 comments

  • Support bundles
  • Check each pass inside
  • Check structure of bundle

lol768 avatar Aug 01 '22 17:08 lol768

@lol768 @tomasmcguinness

my .pkpass is generating but here are 2 problem

  1. 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.

  2. 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/[email protected]")));
            request.Images.Add(PassbookImage.Icon3X, System.IO.File.ReadAllBytes(Server.MapPath("~/Icons/[email protected]")));

            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/[email protected]")));
            request.Images.Add(PassbookImage.Logo3X, System.IO.File.ReadAllBytes(Server.MapPath("~/Icons/[email protected]")));


            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");
            ```

singhdilip1007 avatar Oct 04 '23 11:10 singhdilip1007

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 avatar Oct 04 '23 13:10 tomasmcguinness

@tomasmcguinness I've double checked and pass type identifier and team identifier match properly Once using your validate option, getting below

image (13)

Please help me where & what is the issue so that I can go ahead.

singhdilip1007 avatar Oct 04 '23 13:10 singhdilip1007