Skip to content

Commit 6347ab8

Browse files
committed
Improve DocC
1 parent 4bc14f0 commit 6347ab8

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

Sources/WalletOrders/OrderBuilder.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Foundation
33
@_spi(CMS) import X509
44
import Zip
55

6-
/// A builder for generating order content bundles.
6+
/// A tool that generates pass content bundles.
77
public struct OrderBuilder: Sendable {
88
private let pemWWDRCertificate: String
99
private let pemCertificate: String
@@ -18,6 +18,8 @@ public struct OrderBuilder: Sendable {
1818

1919
/// Creates a new ``OrderBuilder``.
2020
///
21+
/// > Tip: Obtaining the three certificates files could be a bit tricky. You could get some guidance from [this guide](https://github.com/alexandercerutti/passkit-generator/wiki/Generating-Certificates) and [this video](https://www.youtube.com/watch?v=rJZdPoXHtzI). Those guides are for Wallet passes, but the process is similar for Wallet orders.
22+
///
2123
/// - Parameters:
2224
/// - pemWWDRCertificate: Apple's WWDR.pem certificate in PEM format.
2325
/// - pemCertificate: The PEM Certificate for signing orders.

Sources/WalletPasses/PassBuilder.swift

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Foundation
33
@_spi(CMS) import X509
44
import Zip
55

6-
/// A builder for generating pass content bundles.
6+
/// A tool that generates pass content bundles.
77
public struct PassBuilder: Sendable {
88
private let pemWWDRCertificate: String
99
private let pemCertificate: String
@@ -18,6 +18,8 @@ public struct PassBuilder: Sendable {
1818

1919
/// Creates a new ``PassBuilder``.
2020
///
21+
/// > Tip: Obtaining the three certificates files could be a bit tricky. You could get some guidance from [this guide](https://github.com/alexandercerutti/passkit-generator/wiki/Generating-Certificates) and [this video](https://www.youtube.com/watch?v=rJZdPoXHtzI).
22+
///
2123
/// - Parameters:
2224
/// - pemWWDRCertificate: Apple's WWDR.pem certificate in PEM format.
2325
/// - pemCertificate: The PEM Certificate for signing passes.
@@ -40,6 +42,8 @@ public struct PassBuilder: Sendable {
4042

4143
/// Generates a signature for a given personalization token.
4244
///
45+
/// See <doc:PersonalizablePasses> for more information.
46+
///
4347
/// - Parameter data: The personalization token data to sign.
4448
///
4549
/// - Returns: The generated signature as `Data`.
@@ -102,7 +106,7 @@ public struct PassBuilder: Sendable {
102106
/// - Parameters:
103107
/// - pass: The pass to generate the content for.
104108
/// - sourceFilesDirectoryPath: The path to the source files directory.
105-
/// - personalization: The personalization information for the pass.
109+
/// - personalization: The personalization information for the pass. See <doc:PersonalizablePasses> for more information.
106110
///
107111
/// - Returns: The generated pass content as `Data`.
108112
public func build(

Sources/WalletPasses/WalletPasses.docc/PersonalizablePasses.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Create and sign personalized passes for the Apple Wallet app.
66

77
> Warning: This section is a work in progress. Testing is hard without access to the certificates required to develop this feature. If you have access to the entitlements, please help us implement this feature.
88
9-
Pass Personalization lets you create passes, referred to as personalizable passes, that prompt the user to provide personal information during signup that will be sent to your server.
9+
Pass Personalization lets you create passes, referred to as personalizable passes, that prompt the user to provide personal information during signup that will be sent to your server and used to update the pass.
1010

1111
> Important: Making a pass personalizable, just like adding NFC to a pass, requires a special entitlement issued by Apple. Although accessing such entitlements is hard if you're not a big company, you can learn more in [Getting Started with Apple Wallet](https://developer.apple.com/wallet/get-started/).
1212
@@ -24,12 +24,17 @@ A personalizable pass is just a standard pass package with the following additio
2424
To make a pass personalizable, you need to pass a ``PersonalizationJSON`` object to ``PassBuilder/build(pass:sourceFilesDirectoryPath:personalization:)``, and the source files directory must contain the `[email protected]` file.
2525

2626
Once you've built the pass, you can distribute it like any other pass.
27+
2728
The user will be prompted to provide the required personal information when they add the pass.
28-
Wallet will then send the user personal information to your server.
29+
30+
Wallet will then send the user personal information to your server to be stored and used to update the pass, along with a personalization token that you have to sign and return to Wallet in the response.
31+
You can use the ``PassBuilder/signature(for:)`` to sign the personalization token.
32+
2933
Immediately after that, the Wallet app will request the updated pass.
3034

3135
> Important: The updated and personalized pass **must not** contain the `personalization.json` file.
3236
3337
## Topics
3438

3539
- ``PersonalizationJSON``
40+
- ``PassBuilder/signature(for:)``

0 commit comments

Comments
 (0)