Passbook - магазин открыток с галочками - PullRequest
0 голосов
/ 11 июня 2018

Я хочу иметь возможность создать магазинную карту, которая работает как перфокарта.Каждый раз, когда кто-то покупает хлеб, на его проходе должен появляться еще один удар.

Должен выглядеть примерно так, как показано ниже.

enter image description here

Изображение с кружочками - strip@2x.png.Каков наилучший способ обновить это?Я подумываю менять изображение на новое каждый раз, когда я отправляю push-уведомление, и пароль получает обновление.Но из документации я не уверен, смогу ли я сделать это ... из документации: https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/PassKit_PG/Updating.html#//apple_ref/doc/uid/TP40012195-CH5-SW1

To send the list of serial numbers, do the following:

Look at the registrations table, and determine which passes the device is registered for.

Look at the passes table, and determine which passes have changed since the given tag. Don’t include serial numbers of passes that the device didn’t register for. If no update tag is provided, return all the passes that the device is registered for. For example, you return all registered passes the very first time a device communicates with your server.

Compare the update tags for each pass that has changed and determine which one is the latest. Return the latest update tag to the device.

Respond with this list of serial numbers and the latest update tag in a JSON payload. For example:

{
    "serialNumbers" : ["001", "020", "3019"],
    "lastUpdated" : "1351981923"
}

Как я могу подойти к этому?Пытаюсь ли я обновить весь проход каждый раз, когда приходит новое push-сообщение?Так происходит обновление или меняются только некоторые биты файла json (pass.json)?Есть ли более умный способ добиться этого?

...