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:
- iOS 16.4.1
I found the method viewDidLoad was not be called after invoking method init.
Thanks for reading and any advice.