-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename
Personalization
to PersonalizationInfo
- Loading branch information
1 parent
6e8fc58
commit fbfe7eb
Showing
6 changed files
with
39 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,8 +28,8 @@ If the pass requires personalization, and if it was not already personalized, cr | |
|
||
In the ``PassDataModel/sourceFilesDirectoryPath(on:)`` method, you have to return two different directory paths, depending on whether the pass has to be personalized or not. If it does, the directory must contain the `[email protected]` file. | ||
|
||
Finally, you have to implement the ``PassDataModel/passJSON(on:)`` method as usual, but remember to use in the `PassJSON.Properties` initializer the user info that will be saved inside ``Personalization`` after the pass has been personalized. | ||
Each ``Personalization`` instance has a reference to the pass it belongs to, so you can easily retrieve the user info for the pass. | ||
Finally, you have to implement the ``PassDataModel/passJSON(on:)`` method as usual, but remember to use in the `PassJSON.Properties` initializer the user info that will be saved inside ``PersonalizationInfo`` after the pass has been personalized. | ||
Each ``PersonalizationInfo`` instance has a reference to the pass it belongs to, so you can easily retrieve the user info for the pass. | ||
|
||
### Implement the Web Service | ||
|
||
|
@@ -39,12 +39,12 @@ Build the pass bundle with a `PassBuilder` as usual and distribute it. | |
|
||
The user will be prompted to provide the required personal information when they add the pass. | ||
|
||
Wallet will then send the user personal information to your server, which should be saved in the ``Personalization`` table, along with a personalization token that you have to sign and return to Wallet in the response. | ||
Wallet will then send the user personal information to your server, which should be saved in the ``PersonalizationInfo`` table, along with a personalization token that you have to sign and return to Wallet in the response. | ||
You can use the `PassBuilder.signature(for:)` method to sign the personalization token. | ||
|
||
Immediately after that, Wallet will request the updated pass. | ||
This updated pass will contain the user personalization data that was previously saved inside the ``Personalization`` table. | ||
You can access the pass linked to the personalization data by using the ``Personalization/pass`` field. | ||
This updated pass will contain the user personalization data that was previously saved inside the ``PersonalizationInfo`` table. | ||
You can access the pass linked to the personalization data by using the ``PersonalizationInfo/pass`` field. | ||
|
||
> Important: This updated and personalized pass **must not** contain the `personalization.json` file, so make sure that the ``PassDataModel/personalizationJSON(on:)`` method returns `nil` when the pass has already been personalized. | ||
|
48 changes: 24 additions & 24 deletions
48
...els/Concrete Models/Personalization.swift → ...Concrete Models/PersonalizationInfo.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters