在 swift 项目中导入 PayPal-iOS-SDK

卡兹工作室

我想在我的 swift 项目中使用 PayPal-iOS-SDK。

https://github.com/paypal/PayPal-iOS-SDK

我使用 CocoaPods 并将 LSApplicationQueriesSchemes 设置为 info.plist。

但我仍然在 AppDelegate.swift 中遇到“使用未解析的标识符‘PayPalMobile’”错误。

PayPalMobile .initializeWithClientIds(forEnvironments: [PayPalEnvironmentProduction: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
                                                            PayPalEnvironmentSandbox: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"])

我是否需要做更多的过程才能使用 PayPal-iOS-SDK?

斯捷潘·瓦尔奇辛

我想,为了使用外部库,您错过了一些步骤。如果您正确设置了 LSApplicationQueriesSchemes,您是否在 podfile 中包含了这些行?

pod 'PayPal-iOS-SDK'

之后,您应该pod install在您的项目路径中从您的 CLI调用

要使用此库,您需要使用导入,如@Scriptable 所述。

import PayPalMobile 

将此写在文件顶部需要使用的地方。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章