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

Passbook.Generator.Exceptions.RequiredFieldValueMissingException: 'Missing value for field [key: 'key']. Every field must have a value specified in the template or the individual pass.' #193

Open
NikunjMoltech opened this issue Jul 5, 2024 · 0 comments

Comments

@NikunjMoltech
Copy link

NikunjMoltech commented Jul 5, 2024

I am having this issue from few days it was not occurring during implementation (before 4 weeks), Please someone give me proper guidance to resolve it, Thanks You.

does anyone have list of all rquired fields for the all pass types!

cardInfo is the objecy which have string values its not null in any case.
configuration file values are also not null.
I have added this fields in my request.


  var request = new PassGeneratorRequest
  {
      Style = PassStyle.Generic,
      AppleWWDRCACertificate = appleCert,
      PassbookCertificate = passCert,
      TeamIdentifier = _configuration["AppleWalletTeamIdentifier"],
      Description = "ABC Membership Card",
      OrganizationName = "ABC",
      GroupingIdentifier = objectId.ToString(),
      SerialNumber = passId,
      PassTypeIdentifier = _configuration["AppleWalletPassTypeIdentifier"],
      WebServiceUrl = "",
      AuthenticationToken = "",
      LogoText = "",
      Images =
      {
          { PassbookImage.Icon,icon},
          { PassbookImage.Icon2X,icon},
          { PassbookImage.Icon3X,icon},
          { PassbookImage.Logo,logoRectangle},
          { PassbookImage.Logo2X,logoRectangle},
          { PassbookImage.Logo3X,logoRectangle},
          //{ PassbookImage.Background,logoRound},
          //{ PassbookImage.Background2X,logoRound},
          //{ PassbookImage.Background3X,logoRound},
          //{ PassbookImage.Footer,footer},
          //{ PassbookImage.Footer2X,footer},
          //{ PassbookImage.Footer3X,footer},
          //{ PassbookImage.Thumbnail,thumbnail},
          //{ PassbookImage.Thumbnail2X,thumbnail},
          //{ PassbookImage.Thumbnail3X,thumbnail},
      }
  };

  request.BackgroundColor = _configuration["AppleWalletCardBackground"];
  request.LabelColor = "rgb(0,0,0)";
  request.ForegroundColor = "rgb(225,225,225)";

  request.AddHeaderField(new StandardField("", "", ""));
  request.AddPrimaryField(new StandardField()
  {
      Key = "memberName",
      Label = "MEMBER NAME",
      Value = cardInfo.MemberName
  });

  request.AddSecondaryField(new StandardField()
  {
      Key = "member_since",
      Label = "MEMBER SINCE",
      Value = cardInfo.MemberSince
  });

  request.AddAuxiliaryField(new StandardField()
  {
      Key = "email_address",
      Label = "EMAIL ADDRESS",
      Value = cardInfo.Email
  });

  request.AddSecondaryField(new StandardField()
  {
      Key = "expiry_date",
      Label = "EXPIRY DATE",
      Value = cardInfo.ExpiryDate,
      TextAlignment = FieldTextAlignment.PKTextAlignmentLeft
  });

  request.AddAuxiliaryField(new StandardField()
  {
      Key = "membership_tier",
      Label = "MEMBERSHIP TIER",
      Value = cardInfo.MembershipTier,
      TextAlignment = FieldTextAlignment.PKTextAlignmentLeft
  });

  request.AddBarcode(BarcodeType.PKBarcodeFormatPDF417, cardInfo.QRCodeValue, "iso-8859-1");
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

1 participant