How to use 'changeMessage' key in pass.json

限于喜欢 提交于 2019-12-24 16:13:17

问题


I am doing push notification for updating a pass. I can send pushToken to APNs. What about changeMessage key ? How to make it ? How to use it ?


回答1:


To use the changeMessage key, you just add it to your JSON dictionary. Then when a new .pkpass bundle is received, if the new field value is different to the value in the old .pkpass bundle, the change message will trigger.

If you add %@, then this will be replaced with the new value

"auxiliaryFields" : [
  {
    "key" : "rewards",
    "label" : "Reward Points",
    "value" : "88",
    "changeMessage" : "You have %@ reward points"
  }    

In this case, if the device received a new .pkpass with the rewards balance changed to 124 points, an alert of "You have 124 points" would be shown on the lock screen (if the phone was locked), and in the Notification Centre.



来源:https://stackoverflow.com/questions/15943739/how-to-use-changemessage-key-in-pass-json

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!