【发布时间】:2018-05-04 11:29:58
【问题描述】:
我正在开发一个应用程序,允许用户通过该应用程序在电子钱包中添加卡支付通行证。为此,您必须要求 Apple 添加以下权利
我还在我的应用中使用“com.apple.developer.payment-pass-provisioning”这些权利 Apple 为我的团队 ID 授予了此权利,修改了我的配置文件并启用了此权利。
尝试使用以下代码从我的应用程序中调用电子钱包应用程序中的添加卡屏幕
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 值传递给 viewcontoller。
【问题讨论】:
-
您的
libra变量是nil,因为您需要使用PKPassLibrary的实例对其进行初始化 -
谢谢,Paul 它对我有用...
-
现在我可以调用卡片扫描页面并传递卡片详细信息,并使用
PKAddPaymentPassRequestConfiguration它没有预先填充。你能告诉我我在哪里失踪..... -
你知道如何从 iTunes @Paulw11 添加 Card-on-file
-
@Paulw11 如何知道我的银行卡是否已添加到 Apple Wallet 中。
标签: ios objective-c applepay wallet