1

I'm trying to add the FBLoginViewDelegate protocol like this:

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

@interface ViewController : UIViewController<FBLoginViewDelegate>
@property (weak, nonatomic) IBOutlet FBSDKLoginButton *loginButton;
@end

However, I'm getting Cannot find protocol declaration for 'FBLoginViewDelegate'

I've added the FBSDKLoginKit.framework to my Xcode project.

These two answers say to add FacebookSDK.framework to my project and import it:

How to make Xcode find file FacebookSDK.h?

Cannot find protocol declaration for 'FBLoginViewDelegate'

However, the zip that I downloaded and extracted doesn't have a FacebookSDK.framework in it. Here is what I have:

enter image description here

and I downloaded it from Facebook here: https://developers.facebook.com/docs/ios/getting-started

Does anyone know how I can fix this? Or why I don't have FacebookSDK.framework? Thanks!

Community
  • 1
  • 1
user1282637
  • 1,827
  • 5
  • 27
  • 56

1 Answers1

3

Change <FBLoginViewDelegate> to <FBSDKLoginButtonDelegate>.

<FBLoginViewDelegate> is in the previous version of SDK. The current is <FBSDKLoginButtonDelegate>

tuledev
  • 10,177
  • 4
  • 29
  • 49
  • This is correct, I actually just found some info on this. Thank you. By the way, do you happen to know if profile.userId is the unique ID of the user? I will accept this answer now :) – user1282637 Sep 16 '15 at 03:34
  • "know if profile.userId is the unique ID of the user"? I don't understand what do you mean? Anyway, after successfully login you can fetch info like this [[[FBSDKGraphRequest alloc] initWithGraphPath:@"me" parameters:parameters] startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) { if (!error) { NSLog(@"FacebookManager Fetched User Information:%@", result); } else { NSLog(@"FacebookManager Error %@",error); } }]; – tuledev Sep 16 '15 at 03:37
  • Refer this http://stackoverflow.com/questions/29471243/getting-users-personal-info-from-facebook-in-ios – tuledev Sep 16 '15 at 03:39