【问题标题】:Error when downloading Apple Pass in Chrome for iOS在 iOS 版 Chrome 中下载 Apple Pass 时出错
【发布时间】:2019-10-23 10:58:25
【问题描述】:

在使用 Chrome 和 Firefox 的 iPhone 设备上下载 Apple Pass 时出现问题。它在 Safari 上运行良好。在 iOS 版 Chrome 上显示:

Sorry, your Pass cannot be installed to Passbook at this time.

对于 Firefox,它说:

Failed to Add Pass An error occurred while adding the pass to Wallet. Please try again later.

我尝试从桌面浏览器下载 Apple Pass,它会下载,我可以在 iPhone/模拟器上很好地安装它,我认为这不是 pass 本身的问题,而是我缺少的东西响应。

这是我用来返回 Apple Pass 的代码。

private void ReturnResponse(byte[] applePass)
{
    Response.Clear();
    Response.AddHeader("content-disposition", string.Formate("attachment; filename={0}", "sample.pkpass"));
    Response.ContentType = "application/vnd.apple.pkpass"
    Response.BinaryWrite(applePass);
    Response.End();
}

预期结果:

Apple Pass 打开并允许用户将其添加到他们的 Apple Wallet。

【问题讨论】:

    标签: ios iphone google-chrome firefox safari


    【解决方案1】:

    我知道这个问题已经存在一年半了,但截至 2021 年 3 月,这仍然是一个问题。经过 大量 的反复试验,我们设法让它在 Chrome 上运行&火狐。我们的具体问题是请求必须是 GET,并且在下载 Pass 之前我们有一个表单,该表单作为 POST 提交。一旦我们更改表单以提交 GET,问题就解决了。

    我们尝试保留 POST 并返回 201,感觉正确,但问题仍然存在。

    【讨论】:

      【解决方案2】:

      在提供 pkpass 时将我们的请求方法从 POST 更改为 GET,从而可以在 iOS 设备上使用 Google Chrome for Mobile 下载该通行证。

      【讨论】:

      • 也许我误解了一些东西,但对我来说,这看起来就像你只是在说 this answer 有效。
      【解决方案3】:

      这是未经测试的,但我发现了这个我觉得可能相关的链接:

      https://github.com/eymengunay/php-passbook/issues/73

      它说你用来链接到 pass 的锚点应该包含 this 属性:

      target="_system"

      我自己没有测试过这个分辨率。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2016-10-30
        • 2018-11-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2022-12-31
        • 1970-01-01
        相关资源
        最近更新 更多