我正在开发一个应用程序,允许用户通过应用程序在钱包中添加支付卡。为了做到这一点,您必须请求Apple添加以下权限
我还在我的应用程序中使用"com.apple.developer.payment-pass-provisioning“这些权利,苹果为我的团队ID授予了这个权限,用这个权限修改了我的配置配置文件。
尝试使用以下代码从我的应用程序中调用Wallet应用程序中的Add卡屏幕
PKAddPaymentPassRequestConfiguration *request;
request.cardholderName = @"xxxxxxxx";
request.primaryAccountSuffix = @"xxxx";
request.localizedDescription = @"This will add the card to Apple Pay";
request.primaryAccountIdentifier = @"test";
request.paymentNetwork = @"Test";
PKPassLibrary *libra;
[libra openPaymentSetup];
PKAddPaymentPassViewController *vc = [[PKAddPaymentPassViewController alloc] initWithRequestConfiguration:request delegate:self];
vc.delegate = self;
[self presentViewController:vc animated:YES completion:nil];应用程序要崩溃了。由于错误,将Nil值传递给视图控制器。
发布于 2018-05-23 07:01:12
必须初始化PKPassLibrary & PKPaymentPassRequestConfiguration,将PKPassLibrary *libra;替换为PKPassLibrary *libra = [[PKPassLibrary alloc] init];
发布于 2018-05-22 19:54:41
首先使用加密方案创建PKAddPaymentPassRequestConfiguration。然后使用此配置创建PKAddPaymentPassViewController。更新配置变量中所有必需的详细信息。
initWithEncryptionScheme:PKEncryptionSchemeECC_V2];* PKAddPaymentPassRequestConfiguration =[PKAddPaymentPassRequestConfiguration alloc PKAddPaymentPassRequestConfiguration
https://stackoverflow.com/questions/50173886
复制相似问题