.net .pkpass给出的文件在Apple设备上不支持

wwodge7n  于 2023-10-21  发布在  .NET
关注(0)|答案(1)|浏览(173)

我目前正在研究苹果钱包功能,我必须在用户的苹果钱包中保存活动门票。
我正在使用Tomas编写的NuGet包(https://github.com/tomasmcguinness/dotnet-passbook)。
我目前面临的问题是,我从代码中创建了一个.pkpass文件,当我试图在Apple设备中打开该文件时,我会遇到**“文件不支持问题”**,但如果我在Android中打开相同的通行证(PassWallet或Passes),它工作正常。
有人能帮我吗?
下面是我的pass.json文件

{
  "passTypeIdentifier": "pass.tomsamcguinness.events",
  "formatVersion": 1,
  "serialNumber": "121212",
  "description": "My first pass",
  "organizationName": "Test Org",
  "teamIdentifier": "4T64559QVN",
  "sharingProhibited": false,
  "logoText": "Test Inc.",
  "foregroundColor": "rgb(0,0,0)",
  "labelColor": "rgb(0,0,0)",
  "barcodes": [
    {
      "format": "PKBarcodeFormatCode128",
      "message": "10000151",
      "messageEncoding": "ISO-8859-1",
      "altText": "10000010"
    }
  ],
  "eventTicket": {
    "headerFields": [
      {
        "key": "date",
        "label": "Date",
        "value": "16th July"
      }
    ],
    "primaryFields": [
      {
        "key": "event-name",
        "label": "Event",
        "value": "The Hectic Glow in concert"
      }
    ],
    "secondaryFields": [
      {
        "key": "location",
        "label": "Location",
        "value": "Central Park Zoo"
      }
    ],
    "auxiliaryFields": [],
    "backFields": []
  }
}
wsewodh2

wsewodh21#

你能仔细检查通行证的格式版本吗?从你的代码中,我可以看到它被提到为
"formatVersion": 1,
你能试试下面给出的格式版本2吗?

"formatVersion": 2,

看看能不能成功

相关问题