Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FBLoginManager undeclared type

I installed FacebookSDK using Cocoapods, according to Terminal, I have installed FacebookSDK 4.8.0 (CoreKit, ShareKit and LoginKit), I imported the .h files in my BH-File.h, and already initialized everything in my AppDelegate.

For some reason, when trying to log in using a custom button, when I initialize FBLoginManager, I get an error Use of undeclared type "FBLoginManager".

this is my code

if (FBSDKAccessToken.currentAccessToken() == nil)
    {
        let fbLoginManager : FBSDKLoginManager =
        fbLoginManager.logInWithReadPermissions(["public_profile", "email"], fromViewController: self, handler: { (loginResult, error) -> Void in
            if error == nil {
                print (FBSDKAccessToken.currentAccessToken().tokenString)
            }
            else {
                print ("ERROR*****: \(error)")
            }
        })
    }
like image 728
Carlos Luis Urbina Avatar asked Jan 11 '16 17:01

Carlos Luis Urbina


1 Answers

What fixed to me was adding import FBSDKCoreKit and FBSDKLoginKit to my class, for some reason is not enough adding it in the BH-file.h

like image 64
Carlos Luis Urbina Avatar answered Nov 02 '22 23:11

Carlos Luis Urbina