The Facebook SDK for iOS is the easiest way to integrate your iOS app with Facebook. It enables:
You have two ways to set up your app to use the Facebook SDK. If you haven't registered your application with Facebook, the simplest and quickest option is to use the Quick Start tool. The alternative is to skip the Quick Start and use the manual instructions below.
Quick Start for iOS

Unzip the archive to ~/Documents/FacebookSDK.
To add the SDK in Xcode:
~/Documents/FacebookSDK using Finder. ~/Documents/FacebookSDK to the project's Framework Search Paths setting. Insert the following XML snippet into the body of your file just before the final </dict> element.
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb{your-app-id}</string>
</array>
</dict>
</array>
<key>FacebookAppID</key>
<string>{your-app-id}</string>
<key>FacebookDisplayName</key>
<string>{your-app-name}</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
</array>To post-process the results from actions that require you to switch to the native Facebook app or Safari, such as Facebook Login or Facebook Dialogs, you need to connect your AppDelegate class to the FBSDKApplicationDelegate object. To accomplish this, add the folllwing code to your AppDelegate.m file.
// AppDelegate.m
#import <FBSDKCoreKit/FBSDKCoreKit.h>
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[FBSDKApplicationDelegate sharedInstance] application:application
didFinishLaunchingWithOptions:launchOptions];
// Add any custom logic here.
return YES;
}
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
BOOL handled = [[FBSDKApplicationDelegate sharedInstance] application:application
openURL:url
sourceApplication:sourceApplication
annotation:annotation
];
// Add any custom logic here.
return handled;
}Note: In the sample implementation of -application:openURL:sourceApplication:annotation: above, the call to FBSDKApplicationDelegate is required for deferred deep linking to work correctly.
Now that the SDK is installed and configured, the easiest way to test it is to add App Events to your app. App Events help you understand how people are using your app. This is done by logging events via one of 14 predefined events such as added to cart in a commerce app or level achieved in a game. You can even define your own custom events.
To see how many people are using your application, log app activations by adding the following code to your AppDelegate.m file.
// AppDelegate.m
#import <FBSDKCoreKit/FBSDKCoreKit.h>
- (void)applicationDidBecomeActive:(UIApplication *)application {
[FBSDKAppEvents activateApp];
}To verify logging:
There will be a short delay before your activations show on the event dashboard. If you don't see anything, wait a minute and refresh the page.
To learn how to implement App Events and other Facebook products to your app, click one of the buttons below.
Sharing in iOSAdd Facebook LoginAdd App EventsUse Graph APILike Button for iOS