【发布时间】:2017-07-03 04:36:17
【问题描述】:
我已使用 Target 8.4 及更高版本实施 Apple Pay。
当设备有 ApplePay 功能但未配置时,我们必须打开 Wallet 应用程序并启动添加购物车的过程。
当我为 iOS 8.4 实现代码时,PKPaymentButton 没有显示。 它在 iOS 9.0 上运行良好。请检查以下代码是否相同。
if ([PKPaymentAuthorizationViewController canMakePayments]) {
// Card configured
self.btnApplePay = [self.btnApplePay initWithPaymentButtonType:PKPaymentButtonTypePlain paymentButtonStyle:PKPaymentButtonStyleBlack];
}
else {
// Card not configured
self.btnApplePay = [PKPaymentButton buttonWithType:PKPaymentButtonTypeSetUp style:PKPaymentButtonStyleBlack];
}
另外,找到截图的附件。
请提出我需要改进代码的地方。
【问题讨论】:
-
您确定要在 iOS 8.4 上进行测试吗?
PKPaymentButton仅适用于 iOS 8.4 及更高版本。不支持 iOS 8.3 及更低版本。 -
是的,我选择了 iPhone 5 (8.4)
标签: ios objective-c iphone xcode applepay