Use of unresolved identifier 'FBSDKLoginManager'

2.9k Views Asked by At

I am integrating FacebookSDK using Cocoapods. When I create an object of FBSDKLoginManager like let login = FBSDKLoginManager() I get the error "Use of unresolved identifier 'FBSDKLoginManager'". I can see autoComplete and its pointing to correct methods but it still shows the error. Here is my pod file:

platform :ios, '9.0'
use_frameworks!

target 'BuildTheTower' do

pod 'SVProgressHUD'

pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'

end

and here is my bridging header file :

#ifndef ObjectiveC_Bridging_Header_h
#define ObjectiveC_Bridging_Header_h

#import <SVProgressHUD/SVProgressHUD.h>

#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>

#endif /* ObjectiveC_Bridging_Header_h */

Other things such as FBSDKAppEvents.activateApp() and FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions) are working fine but FBSDKLoginManager is not.

2

There are 2 best solutions below

6
Code On

Bridging headers are not needed. Just add import statements.

import FBSDKCoreKit
import FBSDKShareKit
import FBSDKLoginKit

See the official tutorial/docs for more info.

0
ANISH S NAIR On

Use these Import Statements

import FacebookLogin
import FBSDKLoginKit
import FBSDKCoreKit
import FacebookCore
import FirebaseAuth