Implement the Facebook SDK for iOS

You can implement the frameworks in the Facebook SDK for iOS by adding the framework project files to your project workspace and then building your project. Adding the project files to your workspace is a way to use the Facebook SDK if you have trouble using Swift Package Manager or CocoaPods.

Before You Start

This procedure assumes you are using the latest version of iOS and xCode. Learn more at the Apple Developer.

You will need:

A Facebook Developer Account

An App ID for your app

Download the SDK from GitHUB

Step 1: Set Up Your Development Environment

In this step you will extract the Facebook SDK from GitHub and add the framework project files to your app workspace.

Extract the files from GitHub. Open your app in Xcode. In the Navigator area, right click the workspace, and click Add Files. Go to the folder that contains the SDK files from GitHub and open the folder containing the framework workspace you need. Add the framework workspace to your workspace. You can add one or more workspaces:

If You Want ToAdd This Workspace

Allow your app to use the Facebook services


Allow users to log into your app and for your app to ask for permissions to access data


Allow your app to share content on Facebook


Build your workspace.

Step 2: Register and Configure Your App with Facebook

Add Your Bundle Identifier and enable Single Sign-On for your App

The bundle identifier (Bundle ID) should appear in the box below. If the box is empty, find your bundle identifier in your Xcode Project's iOS Application Target and paste it into the box below.
Bundle ID
You can change your bundle identifier in the future via the iOS section on the settings page.
Enable Single Sign On
Enable single sign on for your app by setting Single Sign On to Yes below.
Single Sign On Will launch from iOS Notifications

Step 3: Configure Your Project

Configure the information property list file (info.plist) with an XML snippet that contains data about your app.
  1. Right-click info.plist, and choose Open As Source Code.
  2. Copy and paste the following XML snippet into the body of your file ( <dict>...</dict>).
  3. In <array><string> in the key [CFBundleURLSchemes], replace [APP_ID] with your App ID.
  4. In <string> in the key FacebookAppID, replace [APP_ID] with your App ID.
  5. In <string> in the key FacebookDisplayName, replace [APP_NAME] with the name of your app.
  6. To use any of the Facebook dialogs (e.g., Login, Share, App Invites, etc.) that can perform an app switch to Facebook apps, your application's info.plist also needs to include: <dict>...</dict>).

Step 4: Connect App Delegate

Replace the code in AppDelegate.swift with the following code. This code initializes the SDK when your app launches, and allows the SDK handle results from the native Facebook app when you perform a Login or Share action:
//  AppDelegate.swift

import UIKit
import FBSDKCoreKit

class AppDelegate: UIResponder, UIApplicationDelegate {
    func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
    ) -> Bool {
            didFinishLaunchingWithOptions: launchOptions

        return true
    func application(
        _ app: UIApplication,
        open url: URL,
        options: [UIApplication.OpenURLOptionsKey : Any] = [:]
    ) -> Bool {

            open: url,
            sourceApplication: options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String,
            annotation: options[UIApplication.OpenURLOptionsKey.annotation]



If you are using iOS 13 or above please add the following method to your SceneDelegate:
//  SceneDelegate.swift

func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
    guard let url = URLContexts.first?.url else {

        open: url,
        sourceApplication: nil,
        annotation: [UIApplication.OpenURLOptionsKey.annotation]

Step 5: Build and Then Run Your Project in the Simulator

In Xcode, select an iOS simulator and click Run. Xcode builds your project and then launches the most recent version of your app running in Simulator.