Why use passes?
Easy to use contactlessly or with a barcode
Synced across all devices and backed with iCloud
Intelligently shown on lock screen and in search for quick access Continue the seamless Apple Pay experience into the physical world
Adding passes to Wallet
instead of using the full modal
PKAddPassesViewControllerto add passes, use the automatic-pass-adding API:
func addPasses(_
passes: [PKPass],
withCompletionHandler completion: ((PKPassLibraryAddPassesStatus) -> Void)? = nil
)
// With Swift 5.5 concurrency:
func addPasses(_ passes: [PKPass]) async -> PKPassLibraryAddPassesStatusPresents a simple alert to the user requesting to add or review the passes
Less friction than presenting
PKAddPassesViewControllerLets you handle the completion outcome in the callback
Best practices
Suggest adding passes that were created outside of your app
Add related passes to Wallet as a group
Make it easy for people to quickly add passes they do not have
Let people jump to their passes in Wallet from your app
New
Designing passes
Use pass fields to display relevant text
Use vibrant colors to make your pass stand out
Design a pass that looks great on all devices
Avoid reproducing existing physical passes
Don’t encode user information in the strip image (not shown on Apple Watch)
Passes on Apple Watch
Does not support the strip image
Thumbnail image is not displayed
Users cannot access the pass details
Additional row support
New this year
can only be used in auxiliary fields in an
eventTicketpass typeCan add only one extra row
Auxiliary fields are then displayed on one row up to the limit of fourth fields per row
"auxiliaryFields": [
{
"label": "Date",
"key": "Date",
"value": "June 9, 2018",
"row": 0
}, {
"label": "Section",
"key": "Section",
"value": "10",
"row": 1
}
]Only values of
0and1are supportedOn older versions,
"row"is ignored
Rich pass content
Relevancy
Add this functionality with the
locations,relevantText, andrelevantDatepass JSON fieldsPass appears on lock screen at the right moment
Handles multiple relevant passes
Always add relevancy information and trust the system to present as required
Semantic Tags (new)
Great way to add machine readable information to passes
Relevancy information works in combination with semantic tags
Example
You can add additional related data that is not important for display, but associated with a field.
{
"key": "event",
"label": "Apple Park",
"value": "Revenge Of The Passes",
"semantics": {
"eventName": "Revenge Of The Passes: A Wallet Story",
"venueName": "Apple Park 1",
"venuePhoneNumber": "+1(408)888-8888"
}
}Semantics can be associated with the pass and not with any field, in the following example we tell PassKit that the phone should be muted during the movie (movie ticket example):
{
"semantics": {
"eventType": "PKEventTypeMovie",
"silenceRequested": true,
"duration": 7245
}
}Siri will then be able to offer the user the ability to quickly enable do not disturb at the right time
Contactless passes
Requires an NFC Certificate to get started
Your readers must support the Apple Value added Services protocol
