有什么方法可以检测它何时触及 Apple Pay PKPaymentAuthorizationViewController 上的取消按钮?
Is there any way to detect when the Cancel button it touched on an Apple Pay PKPaymentAuthorizationViewController?
每当 PKPaymentAuthorizationViewController
因任何原因被解雇时,Apple Pay 都会调用以下委托。有没有什么方法可以检测是否只是 取消 按钮被触摸了?
- (void)paymentAuthorizationViewControllerDidFinish:(PKPaymentAuthorizationViewController *)controller
{
[self dismissViewControllerAnimated:YES completion:nil];
}
来自documentation for paymentAuthorizationViewControllerDidFinish:
When the user authorizes a payment request, this method is called after the status from the paymentAuthorizationViewController:didAuthorizePayment:completion: method’s completion block has been shown to the user. When the user cancels without authorizing the payment request, only paymentAuthorizationViewControllerDidFinish: is called.
所以如果
paymentAuthorizationViewController:didAuthorizePayment:completion:
不是先被调用,然后用户点击取消按钮(否则控制器以某种方式被取消)。
每当 PKPaymentAuthorizationViewController
因任何原因被解雇时,Apple Pay 都会调用以下委托。有没有什么方法可以检测是否只是 取消 按钮被触摸了?
- (void)paymentAuthorizationViewControllerDidFinish:(PKPaymentAuthorizationViewController *)controller
{
[self dismissViewControllerAnimated:YES completion:nil];
}
来自documentation for paymentAuthorizationViewControllerDidFinish:
When the user authorizes a payment request, this method is called after the status from the paymentAuthorizationViewController:didAuthorizePayment:completion: method’s completion block has been shown to the user. When the user cancels without authorizing the payment request, only paymentAuthorizationViewControllerDidFinish: is called.
所以如果
paymentAuthorizationViewController:didAuthorizePayment:completion:
不是先被调用,然后用户点击取消按钮(否则控制器以某种方式被取消)。