Problems with dataStyle while creating pass for passbook

490 views Asked by At

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

There are 1 answers

0
PassKit On BEST ANSWER

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.