Retrieving Existing Passes from PassKit
Before starting the provisioning flow, the application should retrieve existing passes from PassKit.
The deviceAccountIdentifier values are required to query the TMP API for the current token status and determine whether a card has already been provisioned on the device or on paired devices such as Apple Watch.
Example
import PassKit
let passLibrary = PKPassLibrary()
let localPasses = passLibrary.passes().compactMap {
$0.secureElementPass?.deviceAccountIdentifier
}
let remotePasses = passLibrary.remoteSecureElementPasses.compactMap {
$0.deviceAccountIdentifier
}
let deviceAccountIdentifiers = localPasses + remotePasses
Local passes represent cards provisioned directly on the iPhone, while remote passes represent cards provisioned on external or paired devices, including Apple Watch.