我正在我的应用程序中使用触摸 ID 探索 Sirikit 以进行付款。在函数句柄中,我调用了触摸 ID 函数,但我在 siri UI 中出现黑屏,如果有什么方法可以帮助我。
func handle(intent: INSendPaymentIntent, completion: @escaping (INSendPaymentIntentResponse) -> Void) {
guard let payee = intent.payee, let amount = intent.currencyAmount else {
return completion(INSendPaymentIntentResponse(code: .unspecified, userActivity: nil))
}
LAContext().evaluatePolicy(.deviceOwnerAuthentication, localizedReason: "Allow siri to do the Payment", reply:
{(accessGranted:Bool, error:Error?) -> Void in
if (accessGranted){
print("Sending \(amount) payment to \(payee)!")
completion(INSendPaymentIntentResponse(code: .success, userActivity: nil))
}
})
print("Sending \(amount) payment to \(payee)!")
completion(INSendPaymentIntentResponse(code: .success, userActivity: nil))
}