我正在使用 Apple Wallet 进行一些测试。我有一张通行证,我想在用户点击按钮时将其添加到用户的钱包中。这是我的代码:
let filePath = Bundle.main.path(forResource: "DealsPasses", ofType: "pkpass")!
let passData = try? Data(contentsOf: URL.init(fileURLWithPath: filePath), options: .alwaysMapped)
let pass = PKPass(data: passData!, error: nil)
let passVC = PKAddPassesViewController(pass: pass)
navigationController?.pushViewController(passVC, animated: true)
然而; 当用户点击按钮时,
AX Exchange error: Error Domain=Accessibility Code=0 "Remote service does not respond to _accessibilityMachPort" UserInfo={NSLocalizedDescription=Remote service does not respond to _accessibilityMachPort}
以〜200 / min的速度向控制台发送垃圾邮件,并且没有显示PKAddPassesViewController(或者如果是,它只是有一个纯白色视图)
在 iPhone SE(设备)上运行 xCode 8
(旁注:将 DealsPasses.pkpass 拖到模拟器中就可以了)