PKPassLibrary not removing pass


I am implementing apple in-app provisioning and I am able to add a credit card to apple wallet via my app for iPhone and Watch.
and I am able to get all these passes and work with them … but when I want to delete one of them nothing happened

this is how I playing with deleting

 let passLib = PKPassLibrary.init();

   let passesTest = passLib.passes();
   let passToRemove = passesTest[0];

passLib.passes(); return all passes that I have in the wallet and are relevant to my app I select one and try to remove it … but nothing happened. The pass is still there also the card is still in the wallet

any advice?


I should have entitlements right because I am able to add card to wallet this is a list of entitlements:
enter image description here

this is logic that I want to implement … it is a React-Native module:

  func removePass(_ data: NSDictionary, resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
    let passTypeIdentifier = data["passTypeIdentifier"] as! String
    let serialNumber = data["serialNumber"] as! String

   let passToRemove = passLib.pass(withPassTypeIdentifier: 
   passTypeIdentifier, serialNumber: serialNumber)



and the passes what I get from passLib.passes(); looks like this

<PKPaymentPass: 0x10611eba0>

(to be readable I had to stringify it)

[ { localizedName: 'Pass',
    serialNumber: '',
    passURL: 'shoebox://card/Nc4q8dwnXB1CGYG-YQRH4bIdhO4=',
    deviceName: 'iPhone',
    passType: 1,
    organizationName: 'Name Bank',
    localizedDescription: 'Name Mastercard Gold',
    isRemotePass: false,
    relevantDate: null,
    authenticationToken: null,
    webServiceURL: null,
    passTypeIdentifier: '' } ]

Source: Ios Questions

Categorised as apple-wallet, ios, ios-provisioning, passbook, swift Tagged , , , ,


Leave a Reply

Your email address will not be published. Required fields are marked *

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us