The device compares the latest version of the pass against the version it had before to determine which fields have changed.
我的问题是:在我自己的应用程序中,如何确定哪些字段发生了变化?通行证是否有诸如版本号之类的字段来指示相同通行证类型 ID 和序列号的通行证更新?
最佳答案
也来自 Passbook Programming Guide .
To receive notifications when the pass library changes, register for the PKPassLibraryDidChangeNotification notification. Pass the instance of PKPassLibrary as the object. The pass library isn’t a singleton; each instance sends its own notifications, and you want the notifications from this particular instance. Use the addObserverForName:object:queue:usingBlock: method to specify that you want to respond on the main queue and provide a block to handle the notification. The user info dictionary of the notification describes what changed. Alternately, use the dispatch_async and dispatch_get_main_queue functions to respond on the main thread.
没有版本号,但您可以检查 manifest.json 的内容或哈希。如果任何哈希值发生了变化,您将知道通行证已更改。
关于ios - 如何将最新版本的通行证与旧版本进行比较以确定哪些字段已更改?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14294792/