I am implementing in-app provisioning in my Xamarin.iOS app but an unable to get a correct response from the pkPassLibrary.CanAddPaymentPass
method.
This is what tells your app if a customer has already added their card to their Apple Wallet so you can disable the button.
Steps to Reproduce
This is a bit difficult to reproduce as it requires entitlements from Apple. But the basics of it are:
var pkPassLibrary = new PKPassLibrary();
var canAddPass = pkPassLibrary.CanAddPaymentPass(primaryAccountIdentifier);
Expected Behavior
pkPassLibrary.CanAddPaymentPass
should tell me if a user a is unable to add a payment pass to their Apple Wallet
Actual Behavior
pkPassLibrary.CanAddPaymentPass
always returns true and therefore tells me nothing.
Am I initialising PKPassLibrary() wrong or something? Is there any way to check if this is a bug in Xamarin?
I did find the issue. For those that come after me you do need to ensure that you register your associatedApplicationIdentifiers
with your payment provider (visa, mastercard, etc). Apple will only let you know about payment passes that are associated with your app. That association is created at the visa/mastercard/etc side of things and is communicated through the panReferenceId
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With