iOS Apple Pay in-App provisioning extension: `viewDidLoad` method not called after invoking `init`

I am coding for Apple Pay in-App provisioning extension, but there was a problem when Apple Wallet load authorization UI extension:

The source code: The principal class .h file

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface IssuerProvisioningViewController : UIViewController

@end

NS_ASSUME_NONNULL_END

The principal class .m file

#import "IssuerProvisioningViewController.h"
#import <PassKit/PassKit.h>

@interface IssuerProvisioningViewController ()<PKIssuerProvisioningExtensionAuthorizationProviding>

@end

@implementation IssuerProvisioningViewController

@synthesize completionHandler;



- (instancetype)init {

    NSLog(@"--- init");

    self = [super init];

    return self;

}



- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {

    NSLog(@"--- initWithNibName nibNameOrNil");

    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];

    return self;

}



- (void)viewDidLoad {

    NSLog(@"viewDidLoad");

    // Do any additional setup after loading the view from its nib.

}

@end

The Info.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>NSExtension</key>
    <dict>
        <key>NSExtensionPointIdentifier</key>
        <string>com.apple.PassKit.issuer-provisioning.authorization</string>
        <key>NSExtensionPrincipalClass</key>
        <string>IssuerProvisioningViewController</string>
    </dict>
</dict>

The entitlement file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.developer.payment-pass-provisioning</key>
    <true/>
</dict>
</plist>

Environment:

  1. iOS 16.4.1

I found the method viewDidLoad was not be called after invoking method init.

Thanks for reading and any advice.

Hi! I'm currently having the same problem, did you manage to find a solution?

There are a few things going on here - you're not calling [super viewDidLoad], which is needed. You also need to call the completion handler: since you never call the completion handler your extension is timing out. Give both of these a go and see if that helps.

Hi! Please I'm working on this same feature but my app does not show up in apple wallet i have created the necessary extensions and returned the necessary values in the status function. Any help on what might be wrong would be appreciated

Could someone give me an example of implementing the non-ui in-App provisioning extension? I couldn't get the cards to appear in the wallet. The methods of super class PKIssuerProvisioningExtensionHandler need any implementation in my principal? My app already has a provisioning using the classic methods.

Hello  @dabaicoin, did you implement the Wallet extension successfully? I couldn't get my app to appear in Wallet app even though I implemented all the necessary things with the NonUI and UI extensions.

iOS Apple Pay in-App provisioning extension: `viewDidLoad` method not called after invoking `init`
 
 
Q