[英]iOS how to take user directly to the Wallet app
我现在正在集成 Apple Pay,我看到了 Apple Pay 的 iOS 人机界面指南。
https://developer.apple.com/ios/human-interface-guidelines/technologies/apple-pay/
当用户点击按钮时如何打开电子钱包应用程序?
查看PKPaymentButton
。 作为 PassKit 的一部分,已经有为此预先构建的按钮。
let setupButton = PKPaymentButton(type: .setUp, style: .black)
可以在PKPaymentButton 参考 中找到更多信息。
编辑:
PKPassLibrary
实际上可以执行该操作。 你可以像这样使用它:
let library = PKPassLibrary()
library.openPaymentSetup()
可以在此处找到更多信息。
注意:上述调用仅适用于真正的 iOS 设备。
目标 C 中的代码,与@Mark 答案相同:
首先,您必须导入 PassKit:
@import PassKit;
并调用func打开钱包App,func:
-(void) openAppleWalletApp {
PKPassLibrary * wallet = [[PKPassLibrary alloc] init];
[wallet openPaymentSetup];
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.