Good day) Colleagues, please tell me how can I change the notification on the locked screen "pass changed" in PKPASS when changing several fields? Thank you very much for your answer
Hi @IlyaSlesarenokS,
You wrote:
Colleagues, please tell me how can I change the notification on the locked screen "pass changed" in PKPASS when changing several fields?
@FIFTY2 is correct. When a pass is updated, the lock screen notification is controlled by the changeMessage key in each filed of your pass.json.
- Add a
changeMessagekey to each field you want to customize. Use%@as the placeholder for the new value.
{
"primaryFields": [
{
"key": "status",
"label": "Status",
"value": "Active",
"changeMessage": "Status updated to %@"
}
],
"secondaryFields": [
{
"key": "gate",
"label": "Gate",
"value": "B12",
"changeMessage": "Gate changed to %@"
},
{
"key": "seat",
"label": "Seat",
"value": "14A",
"changeMessage": "Seat changed to %@"
}
]
}
- Understand the behavior when multiple field change at once. When only one field changes, the lock screen shows that field's
changeMessage. However, when multiple fields change, iOS shows the first change field'schangeMessage(by field order in the JSON). Lastly, when nochangeMessageis defined, the lock screen shows a generic "Pass changed" message. - Adopt a unified message strategy for multi-field updates. If you want a single, unified message when multiple fields change simultaneously, the best approach is to use a dedicated summary field (e.g., in
auxiliaryFieldsorbackFields) that summarizes all changes, and put your customchangeMessageon that field while leaving others without one.
{
"auxiliaryFields": [
{
"key": "updateSummary",
"label": "Last Update",
"value": "Gate B12, Seat 14A, Status Active",
"changeMessage": "Your pass has been updated: %@"
}
]
}
This way, you control exactly what message appears on the lock screen regardless of how many fields change.
Key Considerations:
%@is required in the string—omitting it will cause the placeholder to be empty.- The
changeMessagestring should be localized if your pass supports multiple languages (via the.lprojfolders in your.pkpassbundle). - The notification is only shown if the pass date is delivered via APNs push notification (using your push token from PushToken in the registration endpoint).
Cheers,
Paris X Pinkney | WWDR | DTS Engineer