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:
- Create iOS project
- Add com.apple.developer.payment-pass-provisioning entitlement
- Add in check to see if a user can add a PaymentPass:
var pkPassLibrary = new PKPassLibrary();
var canAddPass = pkPassLibrary.CanAddPaymentPass(primaryAccountIdentifier);
- Deploy to testFlight (PKPassLibrary only works in testFlight)
- Add your card to the Apple Wallet.
- Go back and see if the "Add to Apple Wallet" button is disabled because of the result of pkPassLibrary.CanAddPaymentPass
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?