【问题标题】:Problems with dataStyle while creating pass for passbook为存折创建通行证时出现 dataStyle 问题
【发布时间】:2015-06-19 08:54:07
【问题描述】:

我正在使用 PHP-PKPass 创建一个通行证生成器。一切正常,直到我尝试添加 dateStyle。当我把

'auxiliaryFields' => 数组( 大批( 'key' => '过期', '标签' => '到期日期', 'dateStyle'=> 'PKDateStyleFull', 'timeStyle'=> 'PKDateStyleNone', '价值' => $expires.'T12:00+6.00' ) )

已创建通行证,可在 android 上运行,但在尝试下载时从 iphone 显示“无法从 safari 下载”... 这是生成的通行证 - Pass (not working on iphone)

但如果我删除 'dateStyle' 和 'timeStyle' 部分 -

'auxiliaryFields' => 数组( 大批( 'key' => '过期', '标签' => '到期日期', '价值' => $expires.'T12:00+6.00' ) )

通行证已创建并在 android 和 iphonne 上运行...这是生成的通行证 - Pass (working)

是什么导致了问题?

【问题讨论】:

  • 我们无权下载您的通行证,但在我看来您的日期值 $expires。'T12:00+6.00' 不是有效的 ISO8601 格式。试试改成'value' => $expires.'T12:00+06:00'
  • @PassKit 这是一个非常愚蠢的错误。我修复了它,但仍然是同样的问题。我还修复了链接,以便您可以检查通行证文件。

标签: iphone passbook passkit


【解决方案1】:

根据 cmets 中的信息,您的日期仍然不是有效的ISO 8601 格式。

Jun 22 00:30:05 pfr MobileSafari[4233] <Warning>: Invalid data error reading pass pass.com.retailness.testing.passbook/51136. Unable to parse expires 06-29-2015T12:00+06:00 as a date. We expect dates in "W3C date time stamp format", either "Complete date plus hours and minutes" or "Complete date plus hours, minutes and seconds". For example, 1980-05-07T10:30-05:00.
Jun 22 00:30:05 pfr MobileSafari[4233] <Warning>: PassBook Pass download failed: The pass cannot be read because it isn’t valid.

将日期更改为以年-月-日格式显示,例如2015-06-29T12:00+06:00 你应该会发现它有效。

【讨论】:

    猜你喜欢
    • 2015-09-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-23
    • 2022-01-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多