Open mg opened 2 years ago
Hello @mg
I hate to say that but I don't have the luxury to work on this plugin at the moment. I appreciate your help if you want to create a Pull request with the required changes.
Thanks ❤️
@mg You can try to use this SDK and the method getActionsAvailableForCardSuffix
.
This method returns an array of integer so you have 3 cases:
Hi and thank you for this plugin.
There is a problem with using checkPairedDevicesBySuffix to check if card is already in the wallet, and it is because those 4 numbers are not guaranteed to be unique. I for example have two different cards that share the same last 4 digits, and therefore this method will return true for a card that has not been added to the wallet if another card with the same suffix has previously been added to the wallet.
Apple provides a method to check if a Pass is in the wallet, the containsPass method. Sadly, my Objective C skills are somewhat lacking, and Apples documentation on how to use this method is even more lacking
https://developer.apple.com/documentation/passkit/pkpasslibrary/1617110-containspass?language=objc
Is it possible to add support for this method that accepts the params we have that uniquely identifies the card that we are adding, i.e. the primaryAccountIdentifier.
Sadly and for reasons I cannot understand, the primaryAccountIdentifier we supply when adding a pass, and primaryAccountIdentifier we get back when enumerating cards through passLib passesOfType:PKPassTypePayment are not the same number. If it was we could change the checkPairedDevicesBySuffix to work correctly (e.g. search for the primaryAccountIdentifier, not the primaryAccountSuffix).
Cheers and thanks again for this plugin.