【问题标题】:Braintree Paypal authorization doesn't work on iOS >9Braintree Paypal 授权在 iOS >9 上不起作用
【发布时间】:2016-06-15 04:16:49
【问题描述】:

我使用 Cocoa Pods 将 Braintree SDK 集成到我的 iOS 应用项目中。安装的 Braintree SDK 版本为 4.1.3。我按照 Braintree 网站 (https://developers.braintreepayments.com/guides/paypal/overview/ios/v4) 上的指南设置自定义按钮,该按钮将启动贝宝用户授权过程。按照网络指南中的建议实施所有内容后,我在安装了 iOS 8.4 的设备上使用沙盒环境测试了贝宝授权。一切都完美无缺,但是当我在安装了 iOS 9.2 的设备上尝试我的应用程序时,我无法使用 paypal 进行授权。我在项目中设置了一些断点,发现在BTAppSwitch.m文件中实现的这个方法总是返回NO:

- (BOOL)handleOpenURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication {
    for (Class<BTAppSwitchHandler> handlerClass in self.appSwitchHandlers) {
        if ([handlerClass canHandleAppSwitchReturnURL:url sourceApplication:sourceApplication]) {
            [handlerClass handleAppSwitchReturnURL:url];
            return YES;
        }
    }
    return NO;
}

调用此方法时url的值与此类似:com.myapp.payments://onetouch/v1/success?ba_token=BA-HERMES-SANDBOX-TOKEN

是否有人遇到过类似的问题,您是如何克服的?

【问题讨论】:

    标签: ios objective-c paypal authorization braintree


    【解决方案1】:

    我在布伦特里工作。

    需要几个步骤来确保浏览器开关在 iOS9 上正常工作。

    1) 确保您已添加所需的方案:https://developers.braintreepayments.com/guides/client-sdk/ios/v4#paypal-and-venmo-url-schemes

    2) 确保代理协议设置正确以呈现 SFSafariViewController:https://developers.braintreepayments.com/guides/paypal/client-side/ios/v4#implementing-delegate-protocols

    【讨论】:

    • 我已经尝试过你的建议,但它没有解决问题,因为问题是 ([handlerClass canHandleAppSwitchReturnURL:url sourceApplication:sourceApplication]) 检查不允许在自身内部执行代码并且当我按下“结帐”时按钮没有任何反应
    • 我的意思是什么都没发生 - (BOOL)handleOpenURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication 返回 NO
    • 诊断此问题将非常具体到您的集成。请联系我们的support team 以获得进一步的帮助。
    猜你喜欢
    • 2019-05-04
    • 2017-08-16
    • 2018-11-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-22
    • 2018-11-03
    • 2015-12-14
    相关资源
    最近更新 更多