[WWDC26] What's new in Wallet
이 글은 WWDC 세션의 transcript 와 영상 화면을 Claude Code 로 정리한 글이고, 실제로 쓴 날은 2026-11-25 다. Swift code 는 공개된 Pass Builder 소스(commit e65548e)에 맞게 고쳐 Swift 6.4 의
swift build를 통과시켰다.
세션 정보
- 세션: What’s new in Wallet
- 길이: 15분 49초
- 공개일: 2026-06-08
- 발표: Shaun Merchant (Wallet Engineer)
- 코드: 세션 page 의 snippet 8개, 그리고 open source package apple/pass-builder
한 줄 요약
iOS 27 의 Wallet 은 pass 에 세 가지를 더한다. 큰 artwork 를 앞세운 Poster Generic style, barcode type 네 가지, 그리고 모든 pass style 에서 쓸 수 있는 featured action 이다. 여기에 pass 를 눈으로 보며 만드는 Mac 앱 Pass Designer 와, 그 결과물을 server 에서 채우고 서명하는 Swift package Pass Builder 가 함께 나왔다.
세션의 구성
세션은 발표자 한 사람이 slide 로 pass.json 의 새 key 를 설명하고, 뒤쪽 절반은 Pass Designer 시연과 server code 로 채운다. 예시는 강아지 day care 의 membership card 다.
| 순서 | 내용 | 발표 |
|---|---|---|
| 1 | Poster Generic style | Shaun Merchant |
| 2 | 새 barcode type 과 fallback | Shaun Merchant |
| 3 | Featured action | Shaun Merchant |
| 4 | Pass Designer 시연 | Shaun Merchant |
| 5 | Pass Builder 로 pass 채우기와 서명 | Shaun Merchant |
| 6 | Swift 가 아닌 server 에서 쓰는 방법 | Shaun Merchant |
출처: WWDC26 - What’s new in Wallet
화면에 나온 agenda 는 네 줄이다. Poster Generic, Barcodes, Featured actions, Developer tools 순서다.
Poster Generic
첫 주제는 새 pass style 이다. 지금까지 membership card 나 loyalty card 는 generic 이나 store card style 로 만들었는데, iOS 27 부터는 poster 형태의 style 을 고를 수 있다.
Poster Generic 이란?
Poster Generic 은 pass 전체를 background image 로 덮고 그 위에 글자를 얹는 pass style 이다. 세션은 membership card, loyalty card, store card 에 맞는 style 이라고 소개한다. Apple 문서는 이 style 이 event ticket 의 poster 형태를 바탕으로 하되, event 에만 필요한 semantic tag 요구 사항을 뺀 것이라고 설명한다.
출처: WWDC26 - What’s new in Wallet
화면에는 Coffee Shop, Museum, Shoe Store, Art Museum, Gym, Garden Store 의 pass 가 나란히 놓여 있다. 모두 그림이 pass 면을 가득 채우고, 위쪽 구석에 logo 와 작은 값 하나가 있으며, 아래쪽에 이름과 날짜 같은 field 가 놓인다. 일부는 가운데에 barcode 나 QR code 가 있다.
세션이 말한 pass 앞면의 구성 요소는 다음과 같다.
| 요소 | 위치 |
|---|---|
| Background image | pass 면 전체 |
| Primary logo | 왼쪽 위 |
| Header field | 오른쪽 위 |
| Primary field | 아래쪽 |
| Footer field | 맨 아래 |
| Barcode | 가운데 (선택) |
출처: WWDC26 - What’s new in Wallet
영상에서는 Museum pass 옆에 요소 이름이 하나씩 붙었다가 사라진다. 이 장면은 마지막 차례인 Footer field 로, pass 맨 아래 줄의 “Family Pass” 를 가리킨다. 그 위의 “Ryan Notch” 와 “01/02/27” 이 primary field, 오른쪽 위의 “GUEST NO. 102035” 가 header field 다.
pass.json 에 넣는 방법
Poster Generic 은 pass.json 의 top-level 에 posterGeneric key 를 두는 것으로 쓴다. 아래는 세션 snippet 그대로다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"posterGeneric": {
"headerFields": [
{
"key": "memberID",
"label": "Guest No.",
"value": "102035"
}
],
"footerFields": [
{
"key": "membershipType",
"value": "Family Pass"
}
]
}
posterGeneric
pass style 을 정하는 top-level key 다. 값은 다른 style 과 같은 모양의 field dictionary 다. 자세한 것은 Creating a Poster Generic Pass 에 있다.
세션은 footer field 에 대해 주의할 점을 하나 말한다. pass 앞면에 표시되는 footer field 는 하나뿐이고, footerFields 에 여러 개를 넣으면 첫 번째만 보인다. 그런데 위 문서에는 Poster Generic 이 header field 하나, primary field 최대 네 개, footer field 두 개를 가질 수 있다고 적혀 있다. 세션과 문서의 숫자가 다르다.
이전 iOS 를 위한 fallback
Poster Generic 은 iOS 27 이상에서만 표시된다. iOS 26 이하도 지원하려면 같은 pass.json 에 기존 style key 를 함께 넣는다. 세션의 예는 generic 을 나란히 두는 것이다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"posterGeneric": {
"headerFields": [
{
"key": "memberID",
"label": "Guest No.",
"value": "102035"
}
],
"footerFields": [
{
"key": "membershipType",
"value": "Family Pass"
}
]
},
"generic": {
"headerFields": [
{
"key": "memberID",
"label": "Guest No.",
"value": "102035"
}
],
"footerFields": [
{
"key": "membershipType",
"value": "Family Pass"
}
]
}
문서의 설명도 같다. posterGeneric 이 있으면 새 system 은 그것을 먼저 고르고, 이전 system 은 자기가 아는 style 을 표시한다. 문서는 함께 둘 수 있는 style 로 storeCard, generic, eventTicket, coupon 을 든다.
세션 snippet 은 generic 쪽에도 footerFields 를 그대로 복사해 두었다. 문서에 나온 generic pass 의 field 는 header, primary, secondary, auxiliary, back 이고, 문서의 fallback 예제도 generic 쪽은 primaryFields, secondaryFields, auxiliaryFields 로 다시 짜 놓았다. 실제로 fallback 을 만든다면 두 style 의 field 구성을 따로 짜는 쪽이 맞아 보인다.
새 barcode type
두 번째 주제는 barcode 다. iOS 27 의 Wallet 은 barcode type 네 가지를 새로 그린다.
출처: WWDC26 - What’s new in Wallet
slide 에 적힌 이름은 EAN-13, Code 39, Codabar, Interleaved 2 of 5 (ITF) 다. 기존의 QR, PDF417, Aztec, Code 128 에 이 넷이 더해진다.
format 값
쓰는 방법은 기존과 같다. barcodes 배열의 원소에 format 을 새 값으로 적는다. 세션 snippet 은 원소 안의 쉼표가 빠져 있고 message 와 messageEncoding 의 값이 말줄임표로 되어 있어서, 여기서는 쉼표를 넣고 뒤에 나오는 snippet 의 값으로 채웠다.
1
2
3
4
5
6
7
"barcodes": [
{
"format": "PKBarcodeFormatCodabar",
"message": "123456789",
"messageEncoding": "iso-8859-1"
}
]
barcodes
pass 에 표시할 수 있는 barcode 의 배열이다. system 은 그 기기에서 표시할 수 있는 첫 번째 barcode 를 쓴다. Pass.Barcodes 문서에 적힌 format 의 허용 값은 다음 여덟 가지다.
| type | format 값 | 비고 |
|---|---|---|
| QR | PKBarcodeFormatQR | 기존 |
| PDF417 | PKBarcodeFormatPDF417 | 기존 |
| Aztec | PKBarcodeFormatAztec | 기존 |
| Code 128 | PKBarcodeFormatCode128 | 기존 |
| Code 39 | PKBarcodeFormatCode39 | iOS 27 |
| Codabar | PKBarcodeFormatCodabar | iOS 27 |
| EAN-13 | PKBarcodeFormatEAN13 | iOS 27 |
| ITF | PKBarcodeFormatI2of5 | iOS 27 |
세션은 Codabar 의 값만 보여 준다. 나머지 세 값은 문서와 Pass Builder 소스의 Pass.BarcodeFormat 에서 확인했다.
barcode 의 fallback
새 type 은 이전 iOS 가 그리지 못한다. barcodes 에 새 type 하나만 넣으면 iOS 26 이하에서는 barcode 가 아예 나오지 않는다.
출처: WWDC26 - What’s new in Wallet
같은 Concert pass 두 장이 나란히 있다. 왼쪽 iOS 27 에는 아래쪽에 1차원 barcode 가 있고, 빨간 X 가 붙은 오른쪽 iOS 26 에는 barcode 자리가 비어 있다.
그래서 세션은 barcodes 배열에 여러 type 을 우선순위 순으로 넣으라고 권한다. 앞에서 본 것처럼 system 이 표시할 수 있는 첫 번째 것을 고르기 때문이다.
1
2
3
4
5
6
7
8
9
10
11
12
"barcodes": [
{
"format": "PKBarcodeFormatCodabar",
"message": "123456789",
"messageEncoding": "iso-8859-1"
},
{
"format": "PKBarcodeFormatQR",
"message": "123456789",
"messageEncoding": "iso-8859-1"
}
]
출처: WWDC26 - What’s new in Wallet
위 JSON 을 넣은 결과다. iOS 27 은 Codabar 를, iOS 26 은 QR code 를 그리고, iOS 26 쪽 표시가 초록색 체크로 바뀌었다.
Pass Builder 로 같은 배열을 만들어 pass.json 으로 내보내 보았다. Codabar 와 QR 순서의 두 원소가 위와 같은 key 로 나왔다.
현장의 scanner 가 한 가지 type 만 읽어서 두 번째 type 을 넣을 수 없는 경우도 있다. 세션은 그럴 때의 대안 두 가지를 든다.
출처: WWDC26 - What’s new in Wallet
slide 제목은 “Providing a graceful fallback” 이다. 첫 줄은 credential ID 를 pass 앞면에 잘 보이게 드러내라는 것이고, 둘째 줄은 현장 직원이 그 번호를 손으로 입력하는 절차를 익히게 하라는 것이다. 옆의 pass 에는 오른쪽 위 header field 자리에 “TICKET # 12345” 가 강조되어 있다. 세션은 이 ID 를 primary field 나 header field 에 두라고 말한다.
Featured action
세 번째 주제는 pass 아래에 붙는 action 이다. 지금까지는 일부 event ticket 만 쓸 수 있던 기능이 모든 pass style 로 넓어졌다.
Featured action 이란?
Featured action 은 Wallet 에서 pass 를 열었을 때 pass 바로 아래에 card 로 표시되는 바로가기다. 누르면 link 를 열거나 Maps 같은 앱으로 넘어간다.
iOS 18 에서 나온 2세대 event ticket 은 semantic URL 을 넣으면 pass 아래에 action 을 보여 주었다. iOS 27 은 이것을 일반화해서 어떤 style 의 pass 에든 featuredActions 배열로 action 을 넣을 수 있게 했다.
출처: WWDC26 - What’s new in Wallet
iPhone 화면에 event ticket 이 열려 있고, 그 아래에 card 두 장이 가로로 놓여 있다. 왼쪽은 “View Schedule”, 오른쪽은 “Listen to Music” 이고 옆에 “Featured actions” 라는 label 이 붙어 있다.
featuredActions 배열
action 하나는 identifier, type, url 세 값으로 이루어진다. 세션 snippet 은 다음과 같다.
1
2
3
4
5
6
7
"featuredActions": [
{
"identifier": "my-offer-id",
"type": "membershipBenefits",
"url": "www.example.com/offers"
}
]
featuredActions
pass 아래에 표시할 action 의 배열이다. type 이 icon 과 문구를 정하고, url 이 눌렀을 때 열 곳이다. 쓸 수 있는 type 의 목록은 Defining the metadata of your Wallet Pass 의 “Add Featured Actions” 절에 있다.
출처: WWDC26 - What’s new in Wallet
Museum pass 아래쪽을 확대한 장면이다. card 두 장이 있고, 왼쪽은 분홍색 별 icon 에 “View Membership Benefits” 와 작은 글씨 “Open Link”, 오른쪽은 파란색 화살표 icon 에 “Go to Location” 과 “Open in Maps” 다. icon 색과 문구는 Wallet 이 type 에 맞춰 그리고, 문구는 localize 된다고 세션은 말한다.
문서에 올라 있는 type 은 열네 가지다.
| 분류 | type 값 | 표시 이름 |
|---|---|---|
| Events | viewSchedule | View Schedule |
| Events | watchTrailer | Watch Trailer |
| Events | listenToMusic | Listen to Music |
| Generic | call | Call |
| Generic | place | Go to Location |
| Membership | addToBalance | Add to Balance |
| Membership | order | Order Delivery or Pickup |
| Membership | shop | Shop Online or In-App |
| Membership | membershipBenefits | View Membership Benefits |
| Membership | bookAppointment | Book an Appointment |
| Membership | bookCar | Book a Car |
| Membership | bookFlight | Book a Flight |
| Membership | bookStay | Book a Stay |
| Membership, Generic, Event | viewOffersRewards | View Offers and Rewards |
세션의 Swift snippet 은 type 으로 "viewMembership" 을 쓰는데, 이 값은 위 목록에 없다. JSON snippet 의 membershipBenefits 는 목록에 있다.
action 을 고르는 기준
action 에는 개수 제한이 있다. pass 하나에 최대 두 개다.
출처: WWDC26 - What’s new in Wallet
“Best practices” slide 에는 두 줄이 있다. 의미 있고 관련 있는 action 을 넣을 것, 그리고 가장 중요한 action 이 먼저 오도록 우선순위 순으로 정렬할 것이다. 아래에는 문서 링크로 “Pass.Action” 이 적혀 있다.
Pass Designer
네 번째 주제부터는 도구다. Apple 이 pass 를 만드는 도구 두 가지를 내놓았다.
출처: WWDC26 - What’s new in Wallet
왼쪽이 Pass Designer 의 앱 icon, 오른쪽이 Pass Builder 를 나타내는 기호다.
| 도구 | 형태 | 하는 일 |
|---|---|---|
| Pass Designer | Mac 앱 | pass 를 화면에서 보며 디자인하고 template 으로 저장 |
| Pass Builder | Swift package 와 command-line tool | template 에 값을 채우고 서명해서 .pkpass 로 만듦 |
Pass Designer 는 iOS 가 pass 를 그리는 것과 같은 방식으로 preview 를 그리는 편집기다. pass.json 을 손으로 고치고 기기에 넣어 확인하는 일을 줄여 준다. 문서에 따르면 macOS 27.0 이상이 필요하다.
시연의 흐름
시연은 Stacey 의 강아지 day care 에서 쓸 membership card 를 빈 template 에서 시작해 만드는 과정이다. 창의 왼쪽 sidebar 에 pass 의 구성 요소가 있고, 오른쪽에 preview 가 있다. 순서는 다음과 같다.
- Style 에서 pass style 을 Poster Generic 으로 바꾼다.
- Images 에 강아지 사진을 끌어다 놓아 background 로 쓴다.
- Header Fields 에 field 를 추가한다. key 는
DOG_ID, label 은 “Member ID” 라고 말한다. - Primary Fields 에 key 가
DOG_NAME인 field 를 추가하고 label 은 비워 둔다. - Primary Fields 에 key 가
LOVES, label 이 “Loves” 인 field 를 하나 더 추가한다. - Barcode & NFC 에서 barcode 의 format 을 고른다.
- Images 에 primary logo 를 넣고, Style 에서 Label Color 를 정한다.
- Footer Fields 에 “Stacey’s Doggy Day Care” 를 넣는다.
- File > Save 로 저장한다.
field 의 key 는 나중에 server 에서 값을 바꿔 넣을 때 쓰는 이름이다. 그래서 시연은 key 를 대문자 이름으로 정하고, 값에는 preview 용 placeholder 를 넣는다.
출처: WWDC26 - What’s new in Wallet
DOG_NAME field 를 넣은 직후다. sidebar 의 Primary Fields 아래에 DOG_NAME 이 생겼고, preview 의 사진 아래에 “Finley” 가 굵고 큰 글씨로 나온다. 세션은 첫 번째 primary field 의 label 을 비우면 값이 이렇게 title 처럼 표시된다고 설명한다.
출처: WWDC26 - What’s new in Wallet
Barcode & NFC 의 Format menu 를 연 장면이다. QR 에 체크가 있고 그 아래로 PDF417, Aztec, Code128, Code 39, Codabar, EAN-13, Interleaved 2 of 5 (ITF) 가 있다. 앞에서 본 여덟 가지 format 이 그대로 들어 있다. 시연은 여기서 PDF417 을 고른다. preview 에는 아직 QR code 가 그려져 있고 오른쪽 아래에 “Loves” 와 “Flying Disc” 가 보인다.
출처: WWDC26 - What’s new in Wallet
footer 까지 넣은 모습이다. 왼쪽 위에 발바닥 모양 logo, 오른쪽 위에 “MEMBER ID 1234”, 가운데에 PDF417 barcode, 그 아래에 “Finley” 와 “Loves Flying Disc”, 맨 아래에 “Stacey’s Doggy Day Care” 가 있다. sidebar 에는 Identity & Signing, Style, Images, Barcode & NFC, Fields 가 있고 Fields 아래에 Header, Primary, Footer, Back Fields 가 있다.
저장하면 pkpasstemplate 파일이 나온다. 이 template 을 server 로 가져가 회원마다 값을 바꿔 넣는 것이 다음 단계다.
Pass Builder
마지막 주제는 server 쪽이다. Pass Builder 는 Mac 과 Linux 에서 도는 Swift package 로, template 을 읽어 값을 채우고 서명까지 한다.
README 는 이 package 가 early preview 상태이고 API 가 예고 없이 바뀔 수 있다고 적어 두었다. 요구 사항은 Swift 6.3 이상, macOS 14 이상 또는 Linux 다. 아래 내용은 2026-11-18 의 commit e65548e 기준이다.
package 추가
세션은 local path 로 dependency 를 건다.
1
2
3
4
5
6
7
8
9
10
11
dependencies: [
.package(path: "./path/to/PassBuilder")
],
targets: [
.target(
name: "MyServer",
dependencies: [
.product(name: "PassBuilder", package: "PassBuilder")
]
)
]
README 는 URL 로 거는 방법을 안내한다. 나는 repository 를 pass-builder 라는 directory 로 clone 해서 path 로 걸었는데, 이때 package: 에 적는 이름은 directory 이름을 따라 "pass-builder" 가 되어야 빌드가 되었다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// swift-tools-version: 6.3
import PackageDescription
let package = Package(
name: "Check",
platforms: [.macOS(.v14)],
dependencies: [
.package(path: "../pass-builder")
],
targets: [
.target(
name: "Check",
dependencies: [
.product(name: "PassBuilder", package: "pass-builder")
]
)
]
)
template 에 값 채우기와 서명
세션의 createPass 함수는 회원 한 명의 정보를 받아 template 을 채우고 서명된 pass 의 위치를 돌려준다. 아래는 그 함수를 실제 소스의 API 에 맞게 고친 것이다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import Foundation
import PassBuilder
struct MemberModel {
var id: String
var name: String
var favoriteToy: String
var photoURL: URL
var membershipURL: String
}
func createPass(for doggo: MemberModel) async throws -> URL {
let templateURL = URL(filePath: "template.pkpasstemplate")
var package = try PassPackage(url: templateURL)
package.pass.serialNumber = doggo.id
package.pass.fields.setValue(doggo.name, forKey: "DOG_NAME")
package.pass.fields.setValue(doggo.favoriteToy, forKey: "LOVES")
package.pass.fields.setValue(doggo.id, forKey: "MEMBER_ID")
package.background = try PassImage(url: doggo.photoURL)
var barcode = Pass.Barcode()
barcode.format = .pdf417
barcode.message = doggo.id
package.pass.barcodes = [barcode]
let passCertificate = try PassCertificate(
url: URL(filePath: "pass.p12"),
password: "s3cr3t"
)
let wwdrCertificate = try PassCertificate(url: URL(filePath: "wwdr.cer"))
let signer = PassSigner(
passCertificate: passCertificate,
wwdrCertificate: wwdrCertificate
)
let destinationURL = URL(filePath: "/www/passes/" + doggo.id + ".pkpass")
return try await signer.signPass(package, destination: destinationURL)
}
PassPackage
pass bundle 하나를 나타내는 struct 다. init(url:) 로 pass directory 나 .pkpasstemplate 을 읽고, pass property 가 pass.json 에 해당한다. background, primaryLogo, icon 같은 image 자리도 property 로 있다. 정의는 PassPackage.swift 에 있다.
fields.setValue(_:forKey:)
key 가 같은 field 를 찾아 값을 바꾼다. String, Int, Double, Date 를 받는 네 가지가 있다. pass 에 들어 있는 모든 style 의 field 에 한꺼번에 적용되므로, posterGeneric 과 fallback 용 generic 에 같은 key 를 썼다면 둘 다 바뀐다. 정의는 Pass+FieldsAggregate.swift 에 있다.
PassImage
image 한 자리의 1x, 2x, 3x 파일 묶음이다. init(url:) 에 1x 파일의 위치를 주면 같은 directory 의 @2x, @3x 파일을 함께 읽는다. 정의는 PassImage.swift 에 있다.
PassCertificate
서명에 쓰는 인증서 하나다. .p12 와 DER 형식의 .cer 을 읽는다. pass type identifier 에 묶인 pass certificate 와 Apple 의 WWDR intermediate certificate, 이렇게 두 개가 필요하다. 정의는 PassCertificate.swift 에 있다.
PassSigner
인증서 두 개를 받아 pass 를 서명한다. signPass(_:destination:options:) 는 메모리의 PassPackage 를, signPass(at:destination:options:) 는 disk 의 pass directory 를 서명하고 결과물의 URL 을 돌려준다. 정의는 PassSigner.swift 에 있다.
세션 snippet 과 달라진 곳은 다음과 같다.
| 세션 snippet | 고친 code | 이유 |
|---|---|---|
MemeberModel | MemberModel 을 직접 정의 | 오타이고 정의도 없음 |
PassPackage(url: "template.pkpasstemplate") | try PassPackage(url: URL(filePath:)) | URL 을 받고 throws 임 |
PassImage(url: doggo.photoURL) | try PassImage(url:) | throws 임 |
Pass.Barcode(message:format:) | Pass.Barcode() 뒤에 property 설정 | public initializer 가 init() 뿐임 |
package.featuredActions = [Pass.Action(...)] | 뺌 | 아래에 따로 적음 |
PassCertificate(url: "pass.p12", ...) | URL(filePath:) 로 감쌈 | URL 을 받음 |
wwdrCertifiate: | wwdrCertificate: | 오타 |
URL(string:) | URL(filePath:) | URL(string:) 은 optional 이고 파일 경로에 맞지 않음 |
try signer.signPass(package, writingTo:) | try await signer.signPass(package, destination:) | label 이 다르고 async 이며 URL 을 돌려줌 |
serialNumber 를 넣는 줄은 세션에 없고 내가 더한 것이다. README 의 예제가 template 을 읽은 뒤 serial number 를 정하고 있고, pass 는 pass type identifier 와 serial number 의 조합으로 구분되므로 회원마다 달라야 한다.
시연에서는 header field 의 key 를 DOG_ID 라고 말하는데 code 는 MEMBER_ID 에 값을 넣는다. setValue 는 key 가 맞는 field 가 없으면 아무것도 바꾸지 않으므로, template 의 key 와 code 의 key 가 같은지 확인해야 한다.
featured action 은 고친 code 에서 뺐다. 세션은 package.featuredActions 에 넣지만 소스에서 이 property 는 package.pass.featuredActions 다. 그리고 Pass.Action 에는 public initializer 가 없어서 package 밖에서는 Pass.Action(...) 으로 만들 수 없다. JSON 을 JSONDecoder 로 decode 해서 넣으면 빌드도 되고 pass.json 에도 나오지만, 내부용 _id key 가 함께 찍혀 나온다. 지금 commit 에서 featured action 을 넣는 정해진 길은 template 에 미리 넣어 두거나 뒤에 나오는 protobuf message 를 쓰는 것으로 보인다.
서명 과정
pass 를 손으로 서명하려면 여러 단계를 거쳐야 한다. 세션은 그 단계를 그림으로 보여 주고, Pass Builder 가 이것을 대신한다고 말한다.
출처: WWDC26 - What’s new in Wallet
“Building and signing a pass” 그림에는 여섯 칸이 있다. source file 의 manifest 를 만들고 disk 에 쓴다. 그 manifest 의 PKCS#7 detached signature 를 만들고 disk 에 쓴다. directory 를 압축하고 확장자를 .pkpass 로 붙인다.
PassSigner.signPass(_:destination:options:) 의 구현도 같은 순서다. manifest 를 만들고, 인증서 두 개로 signature 를 만들고, 둘을 bundle 에 넣어 disk 에 쓴 다음 압축한다. 소스의 문서 주석에 따르면 destination 은 서명된 .pkpass 파일의 위치이고, 같은 위치에 파일이 이미 있으면 error 를 던진다. 덮어쓰려면 options 에 .overwriteExisting 을 넣는다.
출처: WWDC26 - What’s new in Wallet
함수를 회원마다 돌린 결과로 세션이 보여 주는 화면이다. Finley, Louie, Mila, Ender, Toby, Scout, Jax, Boomer 여덟 마리의 pass 가 있고, 사진과 이름, 오른쪽 아래의 값이 pass 마다 다르다. layout 과 logo, footer 는 모두 같다.
Swift 가 아닌 server
server 가 Swift 로 되어 있지 않은 경우의 길도 두 가지 소개한다.
출처: WWDC26 - What’s new in Wallet
“Personalizing a pass template” slide 에 swift-java 와 buildpass 두 줄이 적혀 있다.
| 방법 | 내용 |
|---|---|
| swift-java | Swift API 의 Java binding 을 만들어 Java runtime 에서 Pass Builder 를 부름 |
| buildpass | pass package 형식의 protobuf 정의로 message 를 만들고, command-line tool 에 넘김 |
swift-java 에 대해서는 WWDC25 의 Explore Swift and Java interoperability 를 보라고 안내한다.
protobuf 정의는 repository 의 Protobufs directory 에 .proto 파일 25개로 들어 있다. buildpass 는 package 에 함께 들어 있는 executable 이고, 빌드해서 도움말을 띄워 보면 subcommand 가 세 개다.
| subcommand | 하는 일 |
|---|---|
personalize | pkpasstemplate 에 protobuf message 를 적용 |
sign | pass bundle 을 서명해서 배포용으로 만듦 |
validate | 압축하지 않은 pass bundle 을 검사 |
README 에 나온 사용법은 다음과 같다.
1
2
3
buildpass personalize /path/to/template.pkpasstemplate \
--protobuf /path/to/personalization.pb \
--output /path/to/PersonalizedPass.pass
1
2
3
buildpass sign /path/to/MyPass.pass \
--pass-certificate /path/to/certificate.p12 \
--wwdr-certificate /path/to/wwdr.cer
인증서 암호는 BUILDPASS_PASS_CERTIFICATE_PASSWORD 환경 변수로 넘기고, 없으면 buildpass 가 직접 물어본다고 README 에 적혀 있다.
검사는 Swift API 로도 할 수 있다. 빈 PassPackage 를 만들어 PassValidator().validate(_:) 에 넣어 보니 icon@2x 와 icon@3x image 가 필요하다는 error 두 건이 나왔다. 서명하기 전에 빠진 것을 잡는 용도로 쓸 수 있다.
세션의 마무리
세션은 할 일 세 가지를 남기고 끝난다.
출처: WWDC26 - What’s new in Wallet
“Next steps” slide 의 세 줄이다.
- Pass Designer 를 써 본다. Poster Generic 으로 바꿨을 때 자기 pass 가 어떻게 보이는지 여기서 실험할 수 있다.
- 새 barcode type 을 쓴다면 fallback 을 계획한다.
- 자기 pass 에 맞는 의미 있는 action 을 고른다.
정리
| 하고 싶은 일 | 쓰는 것 |
|---|---|
| poster 형태의 membership card | pass.json 의 posterGeneric |
| iOS 26 이하에서도 pass 표시 | posterGeneric 옆에 generic 같은 기존 style |
| 1차원 barcode 표시 | barcodes 의 format 에 Code 39, Codabar, EAN-13, ITF 값 |
| 이전 iOS 에서도 barcode 표시 | barcodes 에 기존 type 을 뒤에 추가 |
| pass 아래에 바로가기 | featuredActions 의 identifier, type, url |
| pass 디자인 | Pass Designer 의 pkpasstemplate |
| server 에서 값 채우기와 서명 | Pass Builder 의 PassPackage, PassSigner |
| Swift 가 아닌 server | swift-java 또는 protobuf 와 buildpass |
실제 프로젝트에 가져갈 점은 다음과 같다.
- Poster Generic 으로 옮길 때는
generic이나storeCard를 지우지 않고 함께 둔다. 두 style 의 field 구성은 따로 짠다. - 새 barcode type 을 쓸 때는
barcodes에 기존 type 을 뒤에 넣는다. scanner 사정으로 그럴 수 없으면 ID 를 header field 나 primary field 에 드러낸다. - featured action 은 두 개까지이고 앞의 것이 더 중요한 것이다. type 은 문서의 목록에서 고른다.
- template 의 field key 는 server code 와 맺는 약속이다. Pass Designer 에서 정한 key 와
setValue의 key 가 같은지 확인한다. - Pass Builder 는 early preview 다. 세션 snippet 을 그대로 쓰지 말고 지금 소스의 API 를 보고 쓴다.