在 iOS (Swift) 中集成 Stripe SDK [英] Integrate Stripe SDK in iOS (Swift)

查看:26
本文介绍了在 iOS (Swift) 中集成 Stripe SDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过手动安装将 Stripe SDK 添加到我的 iOS 应用程序中(在 AppDelegate 中添加了 PassKit.framework 和 StripePublishableKey),但是我在导入语句时遇到了两个问题之一(尝试了 #import <Stripe/Stripe.h>#import "Stripe.h") 被添加到桥接头文件中:

I added Stripe SDK to my iOS app (added PassKit.framework alongside the StripePublishableKey in AppDelegate) via manual installation, but I came across one of two issues when the import statement (tried both #import <Stripe/Stripe.h> and #import "Stripe.h") was added to the bridging header file:

1) 使用 #import ,桥接头不再导入,尽管之前工作过.(我在 Build Settings 下检查了 Swift Compiler 并且文件是正确的.另外,一旦我删除了 Stripe 的元素,问题就消失了).

1) With #import <Stripe/Stripe.h>, the bridging header no longer imports, despite having worked before. (I checked Swift Compiler under Build Settings and the file is correct. Plus once I removed elements of Stripe, the problems went away).

2) 使用 #import "Stripe.h",我收到错误,表明 SDK 根本没有被接收.

2) With #import "Stripe.h", I get errors that indicate that the SDK isn't picked up at all.

(我已经检查了相关线程的 SO 存档,其中指出上述导入语句作为可能的解决方案.而且,作为一个 Swift 学习者,我不太熟悉实现 Obj-C 解决方案.我拼凑了我的可以从 Stripe 的文档中找到.)

(I've checked the SO archive for relevant threads, which pointed to the aforementioned import statements as possible solutions. And, as a Swift learner, I'm not as familiar with implementing Obj-C solutions. I cobbled what I could from Stripe's documentation.)

这是条纹问题吗?我在实施过程中遗漏了什么?

Is this a Stripe problem? What am I missing in implementation?

推荐答案

这对我有用,希望这对发现自己处于同样困境的人有所帮助.首先,它是 #import .接下来,在 Capabilities 下添加打开 Passbook 允许 Passkit.framework 链接到应用程序(或在库中识别).

This worked for me and hopefully this will be helpful for anyone who finds himself/herself in the same predicament. First, it's #import <Stripe/Stripe.h>. Next, adding turning on Passbook under Capabilities allowed Passkit.framework to be linked to the app (or recognized in the library).

这篇关于在 iOS (Swift) 中集成 Stripe SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆