3

i'm creating a pass generator using PHP-PKPass. Everything is working fine until i try to add dateStyle. When I put

'auxiliaryFields' => array(
    array(
    'key'   => 'expires',
    'label' => 'Expiration Date',
    'dateStyle'=> 'PKDateStyleFull',
    'timeStyle'=> 'PKDateStyleNone',
    'value' => $expires.'T12:00+6.00'
    )
)

the pass is created, working on android, but from iphone while trying to download it shows 'can't download from safari'... here is the generated pass - Pass (not working on iphone)

but if i remove 'dateStyle' and 'timeStyle' part -

'auxiliaryFields' => array(
    array(
    'key'   => 'expires',
    'label' => 'Expiration Date',
    'value' => $expires.'T12:00+6.00'
    )
)

the pass is created and working on both android and iphonne... here is the generated pass - Pass (working)

what is causing the problem?

  • 1
    We don't have permission to download your passes but looks to me like your date value $expires.'T12:00+6.00' is not in a valid ISO8601 format. Try changing to `'value' => $expires.'T12:00+06:00'` – PassKit Jun 19 '15 at 09:11
  • @PassKit That was a really stupid mistake. I fixed it but still the same problem. I also fixed the links so you can check the pass files. – Tanvir Ahmad Sohan Jun 19 '15 at 09:36

1 Answers1

2

Further to the info in the comments, your date is still not in a valid ISO 8601 format.

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.

Change the date to display in the Year-Month-Day format, E.g. 2015-06-29T12:00+06:00 and you should find it works.

PassKit
  • 12,231
  • 5
  • 57
  • 75