Hi , I have successfully provisioned my card into Apple wallet. nd after that I am calling passes() API of PKPassLibrary class , getting empty data. let passLibary = PKPassLibrary() let pass = passLibary.passes() // giving empty response. I tried with below API as well, this is giving empty response. let passListItems = passLibary.passes(of: .secureElement).Pls guide me where I am missing something.
PKPassLibrary passes() is giving empty response
The PKPassLibrary.passes()
method only returns passes your app is entitled to see. Are you the issuer of the card provisioned into Wallet? If not, then you won't be able to obtain it in your app.
I am also having this issue, but I don't know how to solve it yet.
Have you found a solution for this Issue? My app is the issuer of the card provisioned into wallet and I cheked the entitlement with
% security cms -D -i iOSTeamProfile.mobileprovision | xmllint --xpath "/plist/dict/key[text()='Entitlements']/following-sibling::dict[position()=1]" -
And the app ID and bundle matches my app data. Any ideas of what could be wrong?
Hi. Did anyone find a solution to this issue? I'm also developing a banking app. All PNO Pass Metadata seems configured correctly. My entitlements also seems configured correctly but for some reason the passes() always return an empty list even if I have the bank card added to the wallet. Did you GGutierrez or anyone find a solution to this? Should this method work with debug build or only production build? I've tested the TestFlight build but got an empty list as well.
I am stuck with the same problem. Any solution please. I have the entitlements. Is there anyway we can check if the meta data is correctly added from the app side?
I am having the same issue. And I am using the Xamarin wrapper. Did anyone find a workaround for this one?
Same here, Cards added but only Visa's Passes comes.
Forgive the formality of this post, but I wanted to ensure this was explained as thoroughly as I could. Our team ran into this very issue and found little documentation on a fix. Through trial and error here is what we came up with:
Issue Overview
During in-app provisioning for Apple Wallet, we encountered an issue where, despite a successful provisioning process, the app could not detect the newly added debit/credit card in the PKPassLibrary
. Specifically, we were validating the card by checking the primaryAccountNumberSuffix
on the returned pass object. However, the returned suffix had an unexpected "x" prefix, which resulted in a false pass detection.
Additionally, we needed to ensure that all metadata was correctly configured on our card provider's (Visa) side, especially regarding the associatedApplicationIdentifiers
key, which allows the app to properly access and manage the issuer’s payment passes.
Problem Details
False Pass Detection:
We were relying on primaryAccountNumberSuffix
for verifying the presence of the newly provisioned card in the wallet. Our expectation was that the suffix would be a direct match with the card's actual suffix. However, in some cases, an "x" prefix was added to the suffix returned by the provisioning process, which caused our comparison logic to fail, and the pass was falsely marked as "not present."
Metadata Misconfiguration:
In addition to the suffix mismatch, we had to ensure that the metadata for our Visa card provider was correctly configured. Specifically, the associatedApplicationIdentifiers
key needed to be verified and aligned with the App ID
in App Store Connect
.
Fixes Implemented
Handling the Suffix Mismatch:
We updated our logic for checking the primaryAccountNumberSuffix
to account for the potential "x" prefix in the returned value. This allowed our validation step to work even when the prefix was present, thus correctly identifying the card in the wallet.
Metadata Updates (Visa):
The associatedApplicationIdentifiers
key plays a crucial role in enabling the app to see, access, and manage the issuer's payment passes. We ensured that the following details were correctly configured for this key:
The App ID was accurately provided from App Store Connect, consisting of:
Team ID
(provided by Apple, unique to our development team).
Bundle ID
(specific to the app) formatted as TeamID.BundleID
.
Ensuring this information was up-to-date allowed the app to interact with the card passes as expected.
Outcome
With these fixes in place:
The app can now successfully detect and display the newly added debit/credit card in the Apple Wallet.
The validation process accounts for variations in the primaryAccountNumberSuffix
, avoiding false pass detections.
Correctly configured metadata ensures the app can manage and activate the payment passes seamlessly.