0

我在网页上有一个链接,该链接应该允许用户从链接下载存折文件,但是在 iPhone 上的 Safari 中单击该链接时,我收到以下错误消息:

Safari cannot download this file.

我在这里阅读过类似的问答,并且 MIME 类型设置为application/vnd.apple.pkpass. 存折可以在 Windows 手机上下载。

关于为什么会出现这种情况以及如何解决这个问题以便用户可以访问存折文件的任何建议?

我已经在桌面上下载了存折,这就是它所包含的内容。

pkpass 包含以下文件:

icon.png
logo.png
strip.png
manifest.json
pass.json
signature

manifest.json 的一个例子:

{
  "icon.png": "fa6b59072ae5c8163c903d8c8b5f2e4a45fbd49b",
  "logo.png": "3165c9be22cbf76e2b3118972dabaef8918390f5",
  "strip.png": "5d15c45f543e8088c227fc54a6c01d1f9f0b1db3",
  "pass.json": "0f536b34a6b73a7799aae43ff9861dde45a6dfc6"
}

pass.json 的一个例子:

{
    "passTypeIdentifier":"pass.com.XXXX.sampleticket",
    "formatVersion":1,
    "serialNumber":"TIC1000000518",
    "description":"XXXX",
    "organizationName":"XXXX",
    "teamIdentifier":"W9XR4FBDD4",
    "logoText":"Dragon Bay",
    "foregroundColor":"rgb(0,0,0)",
    "backgroundColor":"rgb(255,255,0)",
    "labelColor":"rgb(0,0,0)",
    "eventTicket":{
        "headerFields":[],
        "primaryFields":[],
        "secondaryFields":[{"key":"activity",
            "label":"11/20/2015 12:00 AM",
            "value":"One Day at the Museum"
            }],
        "auxiliaryFields":[],
        "backFields":[{
            "key":"terms",
            "label":"Terms & Conditions",
            "value":"XXXX"
        },
        {
            "key":"contact",
            "label":"XXXX",
            "value":"XXXX"
        },
        {
            "key":"legal",
            "label":"Legal",
            "value":"XXXX"
        },
        {
            "key":"notes",
            "changeMessage":"%@","label":"Notes","value":""
        },
        {
            "key":"lastUpdated",
            "label":"Last Updated",
            "dateStyle":"PKDateStyleMedium",
            "timeStyle":"PKDateStyleShort",
            "isRelative":false,
            "value":"2016-01-08T19:00Z"
        }]
    },
    "barcode":{
        "format":"PKBarcodeFormatPDF417",
        "message":"1000000518",
        "messageEncoding":"UTF-8",
        "altText":"1000000518"
    },
    "authenticationToken":"0123456789ABCDEF",
    "webServiceURL":"https://XXXX/passbook.svc"
}

我有一个类似的问题,在此之前我通过确保 webServiceURL 是 https 来解决,但是在这种情况下就是这种情况。

4

1 回答 1

2

检查您的日志,您的签名有问题。

Aug  4 17:08:22 pfr MobileSafari(PassKitCore)[611] <Notice>: Error evaluating trust: <private>
Aug  4 17:08:22 pfr MobileSafari(PassKitCore)[611] <Notice>: Signature validation: *** FAILED ***
Aug  4 17:08:22 pfr MobileSafari(PassKitCore)[611] <Fault>: Invalid data error reading pass <private>. <private>
Aug  4 17:08:22 pfr MobileSafari(PassKitCore)[611] <Notice>: Invalid data error reading pass <private>. <private>
Aug  4 17:08:22 pfr MobileSafari[611] <Notice>: PassBook Pass download failed: The pass cannot be read because it isn\M-b\M^@\M^Yt valid.

检查事项:

  • 每个文件的 SHA1 哈希值是否与清单匹配?
  • 证书是否被吊销或过期?
  • 签名是否包含更新的 Apple WWDR 证书(旧的已于 2 月到期)?
  • 签名是否包含签名日期?

更新:

检查您的签名后,我可以看到它是由过期的 Apple WWDR 证书签名的。此证书于 2016-02-14T18:56:35Z 过期。

Apple Root CA0 080214185635Z 160214185635Z

下载新证书并再次尝试编译通行证。

于 2016-08-04T10:11:10.097 回答