Integrate Stripe SDK in iOS (Swift) - ios

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

Related

Cannot find protocol declaration for *** in my 'MyApp-Swift.h'

I am working on a project that up to now, despite the mess, it was working ok. Today, believe it or not, I have been updating it to Swift 5.
The project has iOS and tvOS targets as well as frameworks, tests, and top selves extensions. The project also was started using Objective-C and over the years has become 90% Swift.
I am not sure at what point something went wrong but, when compiling, I get the following error for all my top self extensions (mostly all tvOS Targets).
I have found similar questions but I can't understand whats going on.
Any ideas?
You are probably missing an import StoreKit in the Swift files that define IAPHelper. Sometimes this gets imported transitively, and Swift doesn't necessarily need it, but the Swift bridging header does.
Ultimately you need to make sure there's an ObjC #import StoreKit; that is evaluated before this line of code.
First, I have to thank Rob for his tips. I wish he could get the points!
After troubleshooting with the tips provided:
Add StoreKit to your linked frameworks list. -> Didn't work
#import StoreKit; before #import <...-Swift.h> -> Showed error use of #import when modules are disabled
I also saw that "...-Swift.h" was only declared in the Build settings of my "...Topself" targets. Still quite unsure why as I would have thought the whole project still have ObjC dependencies... Still quite new to this challenge.
Furthermore, If I unfold the error I could see that there was some kind of error trying to find "...-Swift.h" file.
At this point, I remembered that I am using cocoapods (I don't like you, you don't like me relationship) and I hated to see the warning "...Overrides Enable modules (C - Objective-C)" so I set it to default for the whole project.
Turns out that that for all "...TopSelf" targets, the default value is NO.
By Overriding Enable modules (C - Objective-C) to YES, clean, and build, everything started working again.

how to use SPGooglePlacesAutocomplete in ios

i am using this objective-c wrapper to get the Google Places Autocomplete API result in search bar. i am able to use this sample .but when i copied all file in my project and want to use it i am getting lots of error. how to use it in iOS 8.to make to get Google Places Autocomplete . i am missing something here or what is this error .how to solve this.
import uikit.h into your header file.
#import <UIKit/UIKit.h>
and remove all autorelease statement. they are not allowed in to arc.
that will rectify your general issues.
I'm the one who created that CocoaPods repo you mentioned. It's out of maintenance, as you can find a better solution in Google Places SDK for iOS

Setting up Parse in iOS

I am having some difficulties setting up the Parse framework in iOS. I have set up all the libraries, linked frameworks etc... The specific issue is that I cannot get the subclasses to autocomplete anything related to parse
I have included the libraries...
I have linked the frameworks in build phases...
I want autocompletion similar to this...
But I get nothing related to the Parse framework!!!!
Sorry if this is a dumb question. I have used parse before doing the same thing, but now its not working. Anyone know whats up?
Well, I finally figured out something that works...
Because parse recently split up their frameworks into multiple frameworks you need to include both Parse.framework and ParseUI.framework. This step I had done correctly. BUT, in addition, you need to import the ParseUI framework in the AppDelegate file to get visibility for auto completion of the ParseUI headers... hopefully this mistake on my part saves someone else a headache
I just did the #import <ParseUI/ParseUI.h>
in my AppDelegate.m file...

TBXML in an iOS 8 extension fails to build

In my iOS app I use TBXML for xml processing, it's not officially updated but it still working fine for me.
I'm trying to create a Today extension for iOS 8 and when I add TBXML as a Compile Source I get the following:
TBXML.h
Before adding the extension, I didn't have any build issue with TBXML.
Any ideas of how can I resolve this?
Thanks
Fixed by adding #import <Foundation/Foundation.h> at the beggining of TBXML.h.
Seems that when working with extension, this file is not imported or is imported later
I always want to know WHY. Why would it work before without the include of foundation and not now? What changed? So I dug a little deeper and found the answer: Prefix headers. Xcode 5 must had automatically added a prefix header as a convenience or something. And the new one doesn't. That old prefix header automatically included Foundation, Availability, and UIKit.
Who knows why they changed it. Maybe it has something to do with swift.
A more detailed answer is at: Unknown type name 'NSError' and others

MobFox iOS integration "Cannot find protocol declaration"

I have been trying to integrate MobFox in one of my iOS apps and I'm stuck with a problem.
I have added the framework to the project, and all the other necessary files as well but when I try to add MobFoxVideoInterstitialViewControllerDelegate under #interface MainViewController : UIViewController<UIAlertViewDelegate, MobFoxVideoInterstitialViewControllerDelegate>{ /*...*/ } in my MainViewController.h file, it says Cannot find protocol declaration for MobFoxVideoInterstitialViewControllerDelegate. All the files are there. What might be the problem?
It's old, but I want to answer it. The problem was that someone tried to integrate MobFox already without video and didn't remove the files. So the library used those files instead of new ones. Removing old files has resolved my problem

Resources