I am adding In-App provisioning to my app. I am able to access the Apple Pay Sandbox and I have successfully tested adding a secure element/payment pass to Apple Wallet. However, once the pass has been added to the wallet, I can not access or retrieve the pass from my app. I have confirmed with the PNO that the PNO Pass Metadata Configuration in the testing environment include the correct metadata for "associatedApplicationIdentifiers" and "associatedStoreIdentifiers".
Does anyone know why I am having this issue and how I can resolve it?
Steps used to access pass in Apple Wallet
I am unable to view the pass when I attempt to access it using the PKPassLibrary function as follows:
let library = PKPassLibrary()
if #available(iOS 13.4, *) {
    // This returns an empty array
    library.passes(of: .secureElement)
} else {
    // This also returns an empty array
    library.passes(of: .payment)
}
// This returns an empty array too
library.passes()
Steps used to add pass to Apple Wallet
These are the steps I follow to add the card:
- I create a 
PKAddPaymentPassRequestConfiguration - I use this config to instantiate a 
PKAddPaymentPassViewController. - I provide the 
nonce,nonceSignature, andcertificatesto my PNO along with the card data. - I receive the 
activationData,encryptedPassData, andephemeralPublicKeyfrom my PNO and create aPKAddPaymentPassRequestusing this data. - I add the pass to Apple Wallet.
 
In the addPaymentPassViewController callback, I am able to view the pass data from the .didFinishAdding pass: PKPaymentPass? variable. I am also able to see that the pass has been added from Apple Wallet app. I am not able to access the pass using PKPassLibrary().passes() at this point. I am not able to access the pass at any point after adding it either.
Hi @gtaylor,
Just wanted to add a bit more context for others finding this post.
For anyone else receiving an empty payment library for the user's device, please confirm with your PNO, card issuer, or service provider, that both Wallet extensions are included in the configuration metadata, along with the main issuer app.
For more information, please see the section titled "PNO Pass Metadata Configuration" on the following page:
Passes need to include the extension’s bundle identifier in
associatedApplicationIdentifiersto ensure accurate status of existing passes in Apple Wallet. To learn more about this identifier key, see PNO Pass Metadata Configuration.
Apple Pay on the Web Demo: Wallet Extensions
https://applepaydemo.apple.com/wallet-extensions#pnoPassMetadata
Cheers,
Paris X Pinkney |  WWDR | DTS Engineer