问题
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