vico-aguado / flutter_wallet

Flutter plugin to add pkpass to iOS wallet (Passbook)
Other
5 stars 19 forks source link

Is there a way to check if pass is already added ? #1

Closed sohitEngg closed 4 years ago

sohitEngg commented 4 years ago

Currently I am looking for a library which can add the pass to wallet and check if pass is already present in the wallet, I am able to add pass into wallet by this library. Thank you for providing this library to world.

Can you please tell me some way so that I would be able to check the pass is present in wallet or not.

sohitEngg commented 4 years ago

Adding more code for the checking the pass will resolve this problem. Here below is the desired code.

PKPassLibrary* passLib = [[PKPassLibrary alloc] init]; //check if pass library contains this pass already if([passLib containsPass:newPass]) { //pass already exists in library, show an error message UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:@"Pass Exists" message:@"Pass is already in Passbook." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alertView show]; result([NSNumber numberWithBool:YES]); } else { result([NSNumber numberWithBool:NO]); }