ios - 如何将最新版本的通行证与旧版本进行比较以确定哪些字段已更改?

标签 ios passbook

Passbook Programming Guide说过:

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/

相关文章:

ios6 - Passbook Pass 图像的尺寸是多少?

ios - 存折."The card has expired"

javascript - 如何检测用户是否在 iOS UIWebView 中查看我的网站?

ios - 管理方向变化时 Collection View 单元格布局的正确方法

ios - 启动在后台运行的 iOS 应用程序

ios - Swift - 将核心数据检索到自定义单元格

ios - iOS PASSBOOK-为存折创建多个PKPass时出错

ios - 我如何在 Alamofire 中检查我的请求已发送?

ios - 如何让 UIBarButton 执行自定义功能?

iOS 存折无法从存折扫描中下载