I've done all is mentioned here (https://www.parse.com/docs/ios_guide#fbusers/iOS) for implement in iOS the Facebook Login.
The problem is that i have an compile error "Use of unresolved identifier PFFacebookUtils"
near che line
PFFacebookUtils.initializeFacebook()
in AppDelegate. I've correctly imported the Parse and Facebook Framework into my project.
Are there some bug knowed in Xcode 6 Beta?
Parse docs doesn't mention this yet: After downloading the Parse iOS SDK, You should include the ParseFacebookUtils.framework into your project, then import it in each file you want to use it, like you did for the Parse.framework itself:
#import <Parse/Parse.h>// This use to be enough to use Facebook utilities
#import <ParseFacebookUtils/PFFacebookUtils.h>// But now we should import this framework as well to use Facebook utilitis
Parse team has separated the Facebook related classes from Parse API, hence a ParseFacebookUtils.framework
You may need to
import ParseFacebookUtils
in your AppDelegate
If you want to use PFFacebookUtils or/and PFLogInViewController with swift, you have to do this:
For not V4 version:
#import <ParseFacebookUtils/PFFacebookUtils.h>in bridging header and then import ParseFacebookUtils in swift file. And call PFFacebookUtils.initializeFacebook() somewhere, of course best place for this is application didFinishLaunchingWithOptions.
For V4 version:
#import <ParseFacebookUtilsV4/PFFacebookUtils.h> in bridging header and import ParseFacebookUtilsV4 in swift file. And call PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions) in application didFinishLaunchingWithOptions.
Of course you should have set your bridging header correctly and import frameworks.
Resolved! #import in bridging header
After the update to Parse/FacebookUtils, to import you do #import <Parse/PFFacebookUtils.h>
Related
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.
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
I'm writing login via Facebook in Swift app. I downloaded FacebookSDK, linked libs and created bridge header and added it to Objective-C bridging headers. Imported libraries in it:
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
#import <FBSDKShareKit/FBSDKShareKit.h>
I tried to use classes, but have errors.
In AppDelegate.swift:
FBLoginView.self
Error: "use of unresolved identifier 'FBLoginView'"
Help me plz(
Try doing:
"import FBSDKCoreKit"
"import FBSDKLoginKit"
"import FBSDKShareKit"
at the top of your AppDelegate.swift
I hope that helps
Here is an example project using Facebook Login
I've integrated AdMob in my iOS project but it gives me the following error.
module 'GoogleMobileAds' not found
I have already imported the AdMob SDK into my project and added the following import.
#import GoogleMobileAds;
In the Build Settings of you project set the Define Modules to YES. Then, remove the AdMob Framework from your project, clean your project, and import the AdMob Framework again.
Change the import calls:
#import GoogleMobileAds
to this
#import <GoogleMobileAds/GoogleMobileAds.h>
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 :)