Unable to import spotify ios sdk Obj-C file in Xcode - ios

I imported the Spotify SDK,
I put the name of the bridging file in the bridging header in the project build settings
The Obj-C compaitibilty header is enabled at TARGET level
I have tried using and "Spotify" on the imports in the bridging file
My bridging file is in the root director
Anyone have a guess as to what I am doing wrong?
I want to import this file so I can get back to developing. Maybe there is a setting somewhere I am missing?

As per the Spotify documentation, you should be using
#import <SpotifyiOS/SpotifyiOS.h>
in your bridging header.
Just go through the Spotify documentation once again, validate everything is as it should be and see if that helps.

Related

How to integrate BRLMPrinterKit with iOS for a Flutter App?

I have been trying to integrate the Brother's SDK for printing with the iOS part of my Flutter project.
The following are the steps that I followed :
I added the BRLMPrinterKit.framework & BRLMPrinterKitW.framework to the Framework folder in my Xcode project.
Added $(PROJECT_DIR)/Frameworks to the Framework Search Paths and Header Search Paths.
I then added #import <BRLMPrinterKit/BRLMPrinterKit.h> to the Runner-Bridging-Header.h.
After performing the above steps, when I try to import BRLMPrinterKit in the appdelegate file, I am getting a "No such module BRLMPrinterKit" error.
Any Help will be appreciated.
You don't need to add "import BRLMPrinterKit" in your Swift file. So, just delete this line and you should be OK.
Adding #import <BRLMPrinterKit/BRLMPrinterKit.h> as you did to the Bridging Header is sufficient to be able to use SDK APIs in a Swift file.
A few other tips:
Do NOT include both frameworks in your project.
Use BRLMPrinterKitW.framework if you are ONLY supporting WIFI
Use BRLMPrinterKit.framework if you are supporting Bluetooth (and also WIFI)
You must "embed and sign" the framework via the General tab for the target. Otherwise your app will crash as soon as you run it.
You may need to add #import <BRLMPrinterKit/BRPtouchPrinterKit.h> to your Bridging Header too, if you need to access any APIs from the older v3 SDK (BRPtouchPrinterKit) that do not have equivalent APIs yet in the v4 SDK (BRLMPrinterKit).

Applying Facebook Login to iOS app in Swift

I need to copy said code
#import <FBSDKCoreKit/FBSDKCoreKit.h>
into my app delegate.m file as per Facebook's instructions.
However, I am using Swift not Objective-C and do I don't have .h and .m files for my app delegate (or anything else for that matter), is there any other way in which to import this into my app delegate.swift file?
No need to do that.
Drag the corresponding FBSDKCoreKit framework file in your Xcode project, then just do
import FBSDKCoreKit
in the Swift files.
No need for anything else.
The way you were referring to was for previous versions of the non-Swift SDK.
Reference: https://developers.facebook.com/docs/ios/getting-started/advanced#swift

Firebase bridging header not working

I'm building a Firebase app in swift, I installed the cocoa pod correctly then created an Objective-C file so it would make me a bridging header. When I try to import Firebase elsewhere in the app it says no such module found. I tried to build anyway because sometimes the error will go away but it failed.
Should I do something with my build settings? I've created bridging headers before and never had too (I thought Xcode did that automatically). I'm using version 7.2.1 (the latest) by the way.
Thanks for the help!
#ifndef FirebaseNetwork_Bridging_Header_h
#define FirebaseNetwork_Bridging_Header_h
#import <Firebase/Firebase.h>
#endif
The documentation from firebase says to use import Firebase when in swift. This however causes errors at compile time. After adding the bridging header and importing Firebase.h inside of it, you will be able to access the Firebase api in your swift files.
Make sure to insert the following line in your Podfile:
use_frameworks!
Then open the .xcworkspace file. Clean the build. Compile it.

iOS / WatchKit: Is there a way for the watch kit app(swift) to use the iOS code (Objective C)?

I thought about using a bridging header, but I keep getting fail to import bridging header. Is it possible for watch extension (written in swift) to use code from the iOS App (written in Objective C)? I need to make sure I am doing this correctly and professionally. If I can use bridging header, why am I getting the following error?
:0: error: failed to import bridging header
It might something as simple as a path problem. But what I normally do is create a dummy Objective-C file so that Xcode will create that bridging header for me, then I just copy and paste the path into the extension's build settings.
I've included a demo project which calls a method from an Objective-C file that is imported in the bridging header. I've also had to add the file in the extension's build phases for it to work. I hope this is what you're looking to solve.
https://dl.dropboxusercontent.com/u/5296996/WKTest.zip

How to import FacebookSDK in Header file of Swift iOS application

I am converting my application from Objective- C to swift . In my swift application I have created a header file as explained in following tutorial , but i am getting error 'FacebookSDK/FacebookSDK.h' file not found rather than I imported facebookSDK successfully in my application . Please guid me how to import facebookSDK in swift.
Facebook supports swift natively as of SDK v4.1, so bridging headers are not required now. (by the way, they also deprecated FacebookSDK in favor of FBSDKCoreKit since this version)
Just import the module you need directly:
import FBSDKCoreKit
import FBSDKShareKit
import FBSDKLoginKit
Here is a simple way to do it right:
Create a Swift project
File > New > Cocoa Touch Class > Language Objective-C > Create
Xcode asks you to create a bridging header, let Xcode create that header
Do the steps in: http://www.brianjcoleman.com/tutorial-facebook-login-in-swift/
Add #import <FacebookSDK/FacebookSDK.h> to the Xcode generated bridging header.
Build
You need to add it to your target's build settings:
1.In Xcode, if you go into the build settings for your target, and scroll all the way down you'll find a "Swift Compiler - Code Generation" section.
2.Set "Objective-C Bridging Header" to <#PROJECT_NAME>Bridging-Header.h
3.Now create a Bridging-Header.h file.Import FacebookSDK/FacebookSDK.h to Bridging-Header.h.
This worked for me.Hope will work for u too :)

Resources