With Apple Wallet passes, content can be updated and users can be alerted to changes via notifications that light up their screen. This article demonstrates how to update passes and notify your users of changes to field values. |
Change Messages
Each field object on an Apple Pass can include an optional change message value. This is the text value for the alert that is displayed when the value associated with that field is updated. The change value text must contain the escape value %@
, which is replaced with the field’s new value. For example, “Gate changed to %@” where %@
is replaced with the new value for the associated field.
If you don’t specify a change message, the user isn’t notified when the field changes. |
API Example
The following is an example of a pass field that includes an optional change message value using the key changeMessage
. When updating a pass, if the specified value is different than what is currently included on the pass then the change message will be displayed on the user's device.
{
"fields": {
"TextField": {
"changeMessage": "The value for this field has changed to %@",
"value": "New text value",
"label": "Text Field Label"
}
}
}
Template Example
Change messages can also be specified with a field on a template in the Reach Studio. To specify a change message for a field, select "Show advanced settings" and specify a change message. Note, the change message must contain the escape value %@
otherwise the message will not be displayed.
Best Practices
If you plan on sending promotional or marketing messaging to your users you should consider including a field on the back of a pass that always displays the latest message. This allows the message to persist after a user has dismissed the notification.
Notification Behavior
When a change message is posted to a user's device the screen will light up and display the notification. The user's device will not play a sound or vibrate.
The title displayed with a notification will always be the "Company Name" associated with your Reach account. This can be changed by visiting your Account Settings page.
Related Content
- Update Passes
- Example Reach API Calls
- Urban Airship Reach API Overview
- Urban Airship Reach API Fundamental Concepts