Yellow Path Apple Pay question

Little background. We are trying to build Yellow Path verification flow for Apple Pay. Basically our client wants to launch the app from the Passbook app if the ‘link and provision’ service needs additional verification. The user will launch our app from passbook and then authenticate with our app. After authentication is successful, the user will be presented with a screen to tell them that they need to activate the credit/Debit card. Once the user activates, we will pass the authentication data that is required by the issuer to activate the card along with the data required for activating the card that will be available by calling PKPassLibrary.


This is what we have done so far. We created a button with the following sample code in it for testing purposes

- (IBAction)applePayTestButtonAction:(id)sender {
    if ([PKPassLibrary isPassLibraryAvailable]) {
        NSLog(@"PkPassLibrary is available");
    }else {
        NSLog(@"PkPassLibrary is NOT available");
    }

    if ([PKPassLibrary isPaymentPassActivationAvailable]) {
        NSLog(@"PaymentPassActivationAvailable is available");
    }else {
        NSLog(@"PaymentPassActivationAvailable is NOT available");
    }

    PKPassLibrary* passLib = [[PKPassLibrary alloc] init];

    NSArray * passArray = [passLib passes];
    NSLog(@"number of passes in library are: %lu",(unsigned long)[passArray count]);

    /
    if ([passArray count] > 0)
    {
        PKPass *onePass = [passArray objectAtIndex:0];
     
        NSLog(@"Dump onePass %@", onePass);
     
        PKPaymentPass *paymentPass = [onePass paymentPass];
     
        if (paymentPass) {
            NSLog(@"Payment Pass activationcode %lu", (unsigned long)[paymentPass activationState]);
         
            NSLog(@"PAN: %@, AuthenticationToken: %@, DeviceAccountIdentifier: %@",
                              [paymentPass primaryAccountNumberSuffix],
                              [paymentPass authenticationToken],              
                              [paymentPass deviceAccountIdentifier]);
        }
    }
}


when the button is clicked, the 2 checks (isPassLibraryAvailable) & (isPaymentPassActivationAvailable) are valid. But when we call [passLib passes], we do not get any passes and the count is always 0.

So not sure if this would be the correct call to make in PassBook to get all the PaymentPasses


We have created new development code signing cert and enabled ApplePay and Passbook on the capabilities section for the target within the app.


We are running this app on an iPhone running 8.4.1 and this iPhone has a few credit and debit cards enabled.

This is my observation from our app:

PKPassLibrary returns passes only if we are using iOS distribution certificate (basically the on ehwich you use to submit app to testflight/appstore)

Yellow Path Apple Pay question
 
 
Q