我正在使用BTPayPalDriver调用一次付款请求。但是登录警报需要太多时间才能加载到显示器上。
let payPalDriver = BTPayPalDriver(apiClient:
FunctionManager.APPDELEGATE().braintreeClient)
payPalDriver.viewControllerPresentingDelegate = self
payPalDriver.appSwitchDelegate = self // Optional
let request = BTPayPalRequest(amount: "0.99")
request.currencyCode = "USD" // Optional; see BTPayPalRequest.h for more options
payPalDriver.requestOneTimePayment(request) { (tokenizedPayPalAccount, error) in
if let tokenizedPayPalAccount = tokenizedPayPalAccount {
print("Got a nonce: \(tokenizedPayPalAccount.nonce)")
}
您应该使用- (void)appContextWillSwitch:(nonnull id)appSwitcher;
委托回调,以便在开始显示PayPal UI的过程时收到通知。您可以显示加载程序,直到调用此方法为止。
供参考,这是Braintree iOS SDK Github中的一个相关问题。https://github.com/braintree/braintree_ios/issues/404