josef
josef

Reputation: 255

how do I declare facebookSDK in ios?

I'm trying to make a log in with facebook but I keep getting a error message, " Use of undeclared identifier "FBSDKApplicationDelegate" does anyone know how should I do it.

#import "AppDelegate.h"
#import "FacebookSDK.h"
#import <Parse/Parse.h>
#import <ParseFacebookUtils/PFFacebookUtils.h>
#import <FacebookSDK.h>

@interface AppDelegate ()

@end


@implementation AppDelegate

- (BOOL)application:(UIApplication *)application    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[Parse setApplicationId:@"xxxxxxxxxxxxxxxxxxxx"
              clientKey:@"xxxxxxxxxxxxxxxxxxxx"];
[PFAnalytics trackAppOpenedWithLaunchOptions:launchOptions];
[PFFacebookUtils initializeFacebook];

return [[FBSDKApplicationDelegate sharedInstance] application:application
                                didFinishLaunchingWithOptions:launchOptions];
}

Upvotes: 0

Views: 3659

Answers (5)

V&#245; Mai Trinh
V&#245; Mai Trinh

Reputation: 55

you can import library:

#import <FacebookSDK/FacebookSDK.h>

Upvotes: 0

Vineeth Joseph
Vineeth Joseph

Reputation: 5187

Since version 4.X Facebook has split the SDK in 3 parts:

The SDK is now composed of three frameworks, FBSDKCoreKit, FBSDKLoginKit, and FBSDKShareKit.

So if you are using the latest SDK import FBSDKCoreKit and FBSDKLoginKit in your AppDelegate.

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

See the documentation for more.

Upvotes: 3

Ghanshyam Tomar
Ghanshyam Tomar

Reputation: 770

You need add Library:

#import <FacebookSDK/FacebookSDK.h>

Make sure this library you include in your project or add as framework if you not have then download from hereFacebookSDK

Upvotes: 1

user3502685
user3502685

Reputation:

If you want to work function Login Facebook. You need add Library:

#import <FacebookSDK/FacebookSDK.h>

Upvotes: 1

George McDonnell
George McDonnell

Reputation: 1455

You should add the FBSDKCoreKit.framework to Frameworks in Project Navigator and then use

#import <FBSDKCoreKit/FBSDKCoreKit.h>

See the full setup documentation here.

Upvotes: 1

Related Questions