Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for containsPass method #42

Open
mg opened this issue Sep 27, 2022 · 2 comments
Open

Support for containsPass method #42

mg opened this issue Sep 27, 2022 · 2 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@mg
Copy link

mg commented Sep 27, 2022

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.

@tomavic tomavic added bug Something isn't working help wanted Extra attention is needed labels Sep 30, 2022
@tomavic
Copy link
Owner

tomavic commented Sep 30, 2022

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 ❤️

@thib-lambert
Copy link

@mg You can try to use this SDK and the method getActionsAvailableForCardSuffix.
This method returns an array of integer so you have 3 cases:

  • 0 = ADD
  • 1 = PAY
  • Empty = pass is not presents

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants