xavierlaffargue / webservice-passbook

An Example Implementation of a Passbook Webservice in PHP
GNU General Public License v3.0
13 stars 5 forks source link

How to update data #3

Open RustamKakhramanov opened 5 years ago

RustamKakhramanov commented 5 years ago

I can’t update the map data. The documentation says that I should send data, but I don’t know how exactly. I think I need to send json. But I don’t understand what it should be. For example, I want to update the card balance, how to do this, tell me please. In the db, this is binary data, but I need an example. Here is json from file and code

$static = '{ 'pushDevices': '19e876b60a865970268e84f2ae42c1935b08dc3d662f4d423845bccf0249d421' }'; return $app->stream($stream, 200, array( 'Content-Type' => 'application/vnd.apple.pkpass', 'Content-length' => filesize($nameFile), 'Content-Disposition' => 'attachment; filename="passbook.pkpass"', 'Last-Modified' => gmdate('D, d M Y H:i:s T') ));

reichi commented 5 years ago

In the binary field of the Database should be the complete .pkpass file! When a device asks for updated passen then the database serves the newest pass! For updates you need to save the new pass to the binary field and update the update time field!

RustamKakhramanov commented 5 years ago

Fank you.

В двоичном поле базы данных должен быть полный файл .pkpass! Когда устройство запрашивает обновленный пароль, база данных обслуживает самый новый пропуск! Для обновлений необходимо сохранить новый проход в двоичное поле и обновить поле времени обновления!

Thanks you. And how to make sure that updates themselves are sent to the phone without a request?

reichi commented 5 years ago

This is something I also have struggled with as you can see on issue #2

My passes can update when they du a manual refresh, but I get errors on the push messages.