Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[W3C Date] Some iOS devices can't import the pass #85

Closed
Asp3ctus opened this issue May 24, 2019 · 7 comments
Closed

[W3C Date] Some iOS devices can't import the pass #85

Asp3ctus opened this issue May 24, 2019 · 7 comments

Comments

@Asp3ctus
Copy link
Contributor

I'm trying to figure out why some of the ios devices failing to open generated pass.
I'm testing the same pass on different devices and some works some don't

So far i think it has something to do with IOS becouse after updating ios on iPhone 6 Plus from 12.1.4 to 12.3 it started to work.
Works:
On 5se devices with 12.2 it works
On older 5s with 12.2 it works
On iphone x with 12.3 it works
On iphone 7 plus with 12.2 it works
On iPhone 6 Plus 12.3 works after update from 12.1.4

does not works
On iphone 5 with 10.3.3 it does not work
On iphone 7 with 12.1.4 it does not work - did not yet updated to new 12.3
On iphone 7 with 12.0 it does not work
On iPhone 6 Plus 12.1.4 does not work before update to 12.3

But on thease ^ devies if i import other passes generated from different online services it works.

On android it work.
I tried to open the pass on the mac mini with the newes macos - and it opened it fine with no errors.

This was the reason my i updated from 4.3.1 to 6.4.0 in the first place... but it the newest version did not help.

I don't know that is the reason why it doesn't open on some of the devices.

Then i say it doesn't opens it - i mean
i click to on the link to download pkpass file (all the needed headers are present)
The iphone download it (because if i put break point on server - it waits after resume the error shows) - and shows error safari can not download file (error is in russian Safari не удается загрузить файл.)
if i do the same from chrome i get a much better error it sais that can not enter data to passbook.
Не удалось внести данные в Passbook.
I also tried to send the file over telegram app, but file is not clickable in it - i guess the ios blocks it.

I don't know what else to try, any ideas ?

@tinovyatkin
Copy link
Owner

Did you try to create pass without Cyrillic letters in it?
Is there any chance you can put your pass.json or send me complete generated .pass file by email?
Does your pass works on Safari on macOS?
Can you show your pass serving code? (HTTP server?)

@Asp3ctus
Copy link
Contributor Author

Asp3ctus commented May 24, 2019

I guess the debug read me should be updated.
from the read me i thought that it's enouth to open it in macos
this link helped https://packagist.org/packages/pkpass/pkpass
I connected the iphone to Console app and i see the error
issue is with date
Invalid data error reading pass {*HIDE PASS ID*}/917851106820. Unable to parse update 2019-05-24T17:04:10.867Z 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.
i changed the real pass id to {HIDE PASS ID}

@Asp3ctus
Copy link
Contributor Author

I'll make a pull request with the updated Readme after i fix this.
I guess ios with >12.2 allows less strict date format
i have date in headerFields
headerFields: [ { key: 'update', label: 'обновлено', value: new Date().toISOString(), dateStyle: 'PKDateStyleShort', timeStyle: 'PKDateStyleShort', isRelative: true, } ],

and in response to /api/passkit/:version/devices/:deviceId/registrations/:passId api call
return { lastUpdated: new Date().toISOString(), serialNumbers: [] }

@Asp3ctus
Copy link
Contributor Author

Well just like in #80 using new Date() fixed...
So i close this. And i will make some readme.md changes and make a pull, so it might save some other peoples time:) i spend 2 days on this ))

@PatrickQuintal
Copy link
Collaborator

Mind if I update the title to mention its in relation to a W3C Date error? @Asp3ctus @tinovyatkin
(For future users, I sure know I would of loved to find this link back when I ran into this awhile ago)

Node uses https://en.wikipedia.org/wiki/ISO_8601
Apple uses W3C which is more or less the same except for a pretty significant change.

https://www.w3.org/TR/NOTE-datetime
Exactly the components shown here must be present, with exactly this punctuation.

Basically, the TZD element must be present or they throw an error saying they can't parse it.
+01:00 That bit.

@tinovyatkin
Copy link
Owner

@PatrickQuintal Sure, please! Documentation is a major weak point of this library at the moment.

@tinovyatkin
Copy link
Owner

Just take a note, that in coming patch version the library will be reparsing any date strings with new Date() and this error should disappear

@PatrickQuintal PatrickQuintal changed the title Some iOS devices can't import the pass [W3C Date] Some iOS devices can't import the pass Jun 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants