Skip to content
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

pkpasses support #19

Open
lol768 opened this issue Aug 1, 2022 · 3 comments
Open

pkpasses support #19

lol768 opened this issue Aug 1, 2022 · 3 comments

Comments

@lol768
Copy link

lol768 commented Aug 1, 2022

  • Support bundles
  • Check each pass inside
  • Check structure of bundle
@singhdilip1007
Copy link

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

@tomasmcguinness
Copy link
Owner

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

@singhdilip1007
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants