问题
I have successfully integrated passkit but I am facing issue when updating passbook via push notification. Notification successfully received to wallet but pass not updated.
Following are steps which I have implemented:
- Used XMPP server (PHP).
- used this library in php to generate pass (https://github.com/tschoffelen/PHP-PKPass). I have replaced pass type and team identifier.
- Swift code to add pass to wallet. Pass successfully created and add to wallet.
- To refresh pass "pull to refresh" is working in wallet app.
Here is my full code (PHP + SWIFT): https://www.dropbox.com/sh/e3wk8bwqgv8zs3f/AACZa_x7vD8KByl6WdrrgNExa?dl=0
Here are some logs:
- While creating pass: https://www.dropbox.com/s/j14zfudy9mbllmp/add%20card.png?dl=0
- Add card on wallet : -https://www.dropbox.com/s/yek9rf8js45p8xb/add%20card%20to%20wallet.png?dl=0
- Pull to refresh two request from wallet app https://www.dropbox.com/s/k1sfpxfbqlwwu6q/pull%20to%20refresh%20request%201.png?dl=0 https://www.dropbox.com/s/9jall5xmxpx806o/pull%20to%20refresh%20request%202.png?dl=0
- when push notification received, two request from wallet: https://www.dropbox.com/s/sg3v9sgyu0w1e3n/push%20request%201.png?dl=0 https://www.dropbox.com/s/xd2us3771f2xn3s/push%20request%202.png?dl=0
The error is Server response was malformed...
Please help!
Thanks!
回答1:
I have solved this my self. The problem was in 'Last-Modified' header date format.
It should be header('Last-Modified: ' . gmdate('D, d M Y H:i:s T'));
in PKPass.php file
I received push notification and my pass is now updated automatically.
Thanks!
来源:https://stackoverflow.com/questions/44668916/passkit-pass-not-refreshing-via-push-notification-server-response-was-malfor