【问题标题】:.pkpass giving file not supported on Apple deviceApple 设备不支持 .pkpass 提供文件
【发布时间】:2020-07-15 13:25:17
【问题描述】:

我目前正在开发苹果钱包功能,我必须将活动门票保存在用户的苹果钱包中。

我正在使用 Tomas (https://github.com/tomasmcguinness/dotnet-passbook) 编写的 NuGet 包。

我目前面临一个问题,例如我从代码创建了一个 .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": []
  }
}

【问题讨论】:

    标签: c# .net wallet


    【解决方案1】:

    您能否再次检查通行证的格式版本。从您的代码中,我可以看到它被提及为

    "formatVersion": 1,

    你能试试下面给出的格式版本 2,

    "formatVersion": 2,
    

    看看这是否有效?

    【讨论】:

    • 这应该是评论,而不是答案。
    猜你喜欢
    • 1970-01-01
    • 2019-11-21
    • 2017-01-31
    • 2019-05-17
    • 1970-01-01
    • 2018-06-11
    • 2021-07-28
    • 2018-12-15
    • 1970-01-01
    相关资源
    最近更新 更多