Getting Started

The Facebook SDK for Swift is distributed via CocoaPods and Carthage. While you may compile and use the SDK outside of these systems, we strongly recommend that you choose one of them.


To use the SDK with CocoaPods, add the following lines to your Podfile:


pod 'FacebookCore'
pod 'FacebookLogin'
pod 'FacebookShare'

Each of these dependencies can be used independently. Exclude any that you don't need.


To use the SDK with Carthage, add the following line to your Cartfile:

github "facebook/facebook-sdk-swift"

After performing a carthage install, add FacebookCore.framework, FacebookLogin.framework, and FacebookShare.framework to your project, along with their Facebook SDK for iOS dependencies (FBSDKCoreKit.framework, FBSDKLoginKit.framework, FBSDKShareKit.framework).

Connect Your App Delegate

Add the following to your AppDelegate class. This initializes the SDK when your app launches, and lets the SDK handle results from the native Facebook app when you perform a Login or Share action.

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
  SDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
  return true
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
  return SDKApplicationDelegate.sharedInstance().application(app, open: url, options: options)

Manually Compiling

While not recommended, it is entirely possible for you to build the Facebook SDK for Swift outside of any dependency management system. Note that you will need to manage the process of updating this solution, as well as the dependencies it has on the Facebook SDK for iOS.

To compile the SDK manually:

  1. Start by cloning the repository:

    git clone
  2. Initialize all submodules:

    cd facebook-swift-sdk
    git submodule update --init --recursive
  3. Add the FacebookSwift.xcodeproj as a sub-project to your application's project.
  4. If it is missing, copy the file Bolts.xcodeproj to your application's project.
  5. Add the FacebookCore.framework, FacebookLogin.framework, and FacebookShare.framework build products from that subproject to your application's Link Frameworks and Libraries section, as well as your Embedded Binaries section.
  6. Embed/link Bolts.framework, FBSDKCoreKit.framework, FBSDKLoginKit.framework, and FBSDKShareKit.framework.