Safari无法打开钱包pkpass文件

时间:2018-11-15 13:44:42

标签: c# ios passbook wallet

我目前正在为票证提供钱包支持,并已成功为Android钱包生成.pkpass(存折/钱包)文件。

我正在使用Tomas McGuinness的dotnes-passbook Nuget创建.pkpass文件。

问题是我的.pkpass文件无法以某种方式在Apple电子钱包上运行。 每当我尝试在Mac或iPhone上打开文件时,都会说Safari无法打开此文件。我希望有人能指出我做错了什么。

这些是.pkpass包中的.json文件:

pass.json文件:

{ "passTypeIdentifier": "pass.nl.lvpres",
  "formatVersion": 1,
  "serialNumber": "13843489004291",
  "description": "Dit ticket heeft geen beschrijving.",
  "organizationName": "LVPreserveringssystemen",
  "teamIdentifier": "M644RRJBDM",
  "sharingProhibited": false,
  "logoText": "Kamagura",
  "relevantDate": "2018-11-15T14:06:52+01:00",
  "maxDistance": "1000",
  "locations": [
    {
      "latitude": 51.9207297316102,
      "longitude": 4.4561515896691,
      "relevantText": "U bent dichtbij"
    }
  ],
  "foregroundColor": "rgb(238,238,238)",
  "backgroundColor": "rgb(255,255,255)",
  "labelColor": "rgb(170,170,170)",
  "expirationDate": "2018-12-30T00:00:00",
  "voided": false,
  "eventTicket": {
    "headerFields": [
      {
        "key": "date1",
        "label": "DATUM",
        "dateStyle": "PKDateStyleShort",
        "timeStyle": "PKDateStyleShort",
        "value": "2019-06-01T20:00Z"
      }
    ],
    "primaryFields": [
      {
        "key": "EventNaam",
        "label": "EVENT",
        "value": "Kamagura"
      }
    ],
    "secondaryFields": [
      {
        "key": "Locatie",
        "label": "LOCATIE",
        "value": "Theater Hanzehof"
      },
      {
        "key": "Plaats",
        "label": "PLAATS",
        "value": "Zutphen"
      },
      {
        "key": "Zaal",
        "label": "ZAAL",
        "value": "Theater Demo"
      }
    ],
    "auxiliaryFields": [
      {
        "key": "Rij",
        "label": "RIJ",
        "value": "5"
      },
      {
        "key": "Stoel",
        "label": "STOEL",
        "value": "7"
      },
      {
        "key": "Beschrijving",
        "label": "Beschrijving van de activiteit:",
        "value": "Dit ticket heeft geen beschrijving."
      }
    ],
    "backFields": [
      {
        "key": "keyb2",
        "label": "Over ons",
        "value": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
      }
    ]
  },
  "barcode": {
    "format": "PKBarcodeFormatQR",
    "message": "13843489004291",
    "messageEncoding": "iso-8859-1"
  },
  "authenticationToken": "30246720af7f660136fd833f3886370b9995ba25",
  "webServiceURL": "https://secure.ticketunie.com/Wtickets/Tickets/"
}

还有manifest.json文件:

{
  "pass.json": "c6b01b68b6a4fbada64c34cca61a7bfd181c5bd9",
  "icon.png": "993bcb011b93232db712724260b62d390d822fc6",
  "icon@2x.png": "993bcb011b93232db712724260b62d390d822fc6",
  "logo.png": "2e293ee364e5573bee329202b0996eacfcdb21b4",
  "logo@2x.png": "2e293ee364e5573bee329202b0996eacfcdb21b4",
  "thumbnail.png": "903b2fe6bd4cca1ecba481fea74be04e4231a640",
  "thumbnail@2x.png": "903b2fe6bd4cca1ecba481fea74be04e4231a640",
  "strip.png": "2e293ee364e5573bee329202b0996eacfcdb21b4",
  "strip@2x.png": "2e293ee364e5573bee329202b0996eacfcdb21b4"
}

2 个答案:

答案 0 :(得分:0)

我解决了证书链的问题,事实证明我需要将苹果WWDR导出为.pem而不是.cer。

答案 1 :(得分:-1)

我还生成了一个具有相同签名,manifest和pass.json的.pkpass文件,但是每次生成.pkpass文件后,每次尝试打开它时,它只会显示无法打开的消息。