简体   繁体   中英

Integrate Stripe SDK in iOS (Swift)

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) 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) With #import "Stripe.h" , I get errors that indicate that the SDK isn't picked up at all.

(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?

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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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