简体   繁体   English

Braintree 一次性付款请求加载时间过长

[英]Braintree one time payment request taking too much time to load

I'm using BTPayPalDriver to call a request of one time payment.我正在使用 BTPayPalDriver 调用一次性付款请求。 But the Sign in alert is taking too much time to load on the display.但是登录警报需要太多时间才能加载到显示屏上。

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)")
}

在此处输入图像描述

You should use - (void)appContextWillSwitch:(nonnull id)appSwitcher;您应该使用- (void)appContextWillSwitch:(nonnull id)appSwitcher; delegate callback in order to be notified when the process for showing the PayPal UI will start.委托回调,以便在显示 PayPal UI 的过程开始时得到通知。 You can show a loader until this method is called.在调用此方法之前,您可以显示加载程序。

For reference here is a relevant issue in Braintree iOS SDK Github.供参考的是 Braintree iOS SDK Github 中的相关问题。 https://github.com/braintree/braintree_ios/issues/404 https://github.com/braintree/braintree_ios/issues/404

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM