PKPassLibrary openPaymentSetup restrict to device or watch

300 views Asked by At

I'm working on App that allows users to add their credit card to the Apple Wallet and users can, from the App add the card to both the phone and watch.

Once the user succeeds to add in either device I'm successfully show the card was added to phone or watch, so next time I'll display a message say that and a button saying to add to the remaining device (can be either phone or watch).

Is there a way for to tell the Apple Wallet to display only the watch or the phone when we call openPaymentSetup on PKPassLibrary?

Apple Wallet

From the documentation this doesn't seem possible, but I wanted to double check if I missed anything.

Thank you in advance.

1

There are 1 answers

0
Mickey16 On

You just need to correctly setup the parameter primaryAccountIdentifier of your PKAddPaymentPassRequestConfiguration when initializing PKAddPaymentPassViewController.

That will solve your problem, as stated in documentation of primaryAccountIdentifier : This property lets you filter out the devices that already contain a matching pass.