passkit - pass not refreshing via push notificatio

2019-04-14 23:45发布

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:

  1. Used XMPP server (PHP).
  2. used this library in php to generate pass (https://github.com/tschoffelen/PHP-PKPass). I have replaced pass type and team identifier.
  3. Swift code to add pass to wallet. Pass successfully created and add to wallet.
  4. 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:

  1. While creating pass: https://www.dropbox.com/s/j14zfudy9mbllmp/add%20card.png?dl=0
  2. Add card on wallet : -https://www.dropbox.com/s/yek9rf8js45p8xb/add%20card%20to%20wallet.png?dl=0
  3. 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
  4. 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条回答
▲ chillily
2楼-- · 2019-04-15 00:15

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!

查看更多
登录 后发表回答