ios - Braintree Paypal 授权在 iOS >9 上不起作用

标签 ios objective-c paypal authorization braintree

我使用 Cocoa Pods 将 Braintree SDK 集成到我的 iOS 应用程序项目中。安装的 Braintree SDK 版本为 4.1.3。我按照 Braintree 网站 (https://developers.braintreepayments.com/guides/paypal/overview/ios/v4) 上的指南设置了将启动 paypal 用户授权过程的自定义按钮。按照 web giude 中的建议实现所有内容后,我在安装了 iOS 8.4 的设备上使用沙箱环境测试了 paypal 授权。一切都完美无缺,但是当我在安装了 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

有没有人遇到过类似的问题,你们是如何克服的?

最佳答案

我在布伦特里工作。

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

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

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

关于ios - Braintree Paypal 授权在 iOS >9 上不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35745059/

相关文章:

iphone - [super delloc] 语句之前和之后释放对象的区别?

PayPal IPN 帮助(不是更新数据库)

php - 创建 Paypal 私钥和公共(public)证书

ios - 如何更改 iOS "UITableView negative space"颜色?

objective-c - 从主线程访问 NSOperation 对象的安全方法?

objective-c - 对 NSTableColumn 内容进行排序

c# - 将 PayPal IPN 集成到网站中

ios - 使用默认值初始化 ViewModel

ios - 从烦人格式的字典中提取值

objective-c - UIViewController 在哪里保存其 fromInterfaceOrientation 信息?