gpt4 book ai didi

ios - 无法在 iPhone 6 上打开 Apple Pay 表

转载 作者:塔克拉玛干 更新时间:2023-11-02 10:03:37 25 4
gpt4 key购买 nike

我想做一个示例项目,当用户点击我的应用程序上的“使用 Apple Pay 付款”按钮时打开 Apple Pay 表。

我在装有 iOs 8.1 版(包含 Apple Pay)和 Xcode 6.1 GM 的 iPhone 6 上测试我的应用程序。两者均未正式发布。

我遵循了 this page 上的教程.这是我处理“使用 Apple Pay 付款”按钮的点击事件的代码:

PKPaymentRequest *request = [PKPaymentRequest new];

// Must be configured in Apple Developer Member Center
// Doesn't seem like the functionality is there yet
request.merchantIdentifier = @"my.valid.merchant.identifier";

request.countryCode = @"US";
request.currencyCode = @"USD";

// Let's go!
// if (![PKPaymentAuthorizationViewController canMakePayments]) return;
PKPaymentAuthorizationViewController *authVC = [[PKPaymentAuthorizationViewController alloc] initWithPaymentRequest:request];
authVC.delegate = self;
[self presentViewController:authVC animated:YES completion:nil];

单击“使用 Apple Pay 付款”按钮时,出现此错误:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present a nil modal view controller on target

当检查 PKPaymentAuthorizationViewController canMakePayments] 时,它返回 false。

我不确定错误的原因是 iPhone 的设置还是我的代码。

有人用过 Apple Pay 吗?请帮我。非常感谢。

最佳答案

I test my app on an iPhone 6 with iOs version 8.1 (which contains Apple Pay)

不,最新的测试版 (iOS 8.1 Beta 2) 不包含 Apple Pay。很明显,在他们正在努力的过程中,引擎盖下有一些东西,但它还不适用于开发人员。

这就是为什么 [PKPaymentAuthorizationViewController canMakePayments] 返回 NOauthVCnil 的原因。 Apple Pay 在设置中也不可用,release notes 中也没有提及。 .

关于ios - 无法在 iPhone 6 上打开 Apple Pay 表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26269319/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com