Skip to content

Support for containsPass method #42

@mg

Description

@mg

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghelp wantedExtra attention is needed

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions