Install the SDK
Add the
FacebookCore and FacebookLogin modules to your project. See Installation for instructions using Swift Package Manager, CocoaPods, or Carthage.Configure your Info.plist
Open your app’s
Info.plist and add the following keys. Replace YOUR_APP_ID, YOUR_CLIENT_TOKEN, and Your App Name with the values from your Meta App Dashboard.FacebookClientToken is required as of SDK v13.0. Find it in your app dashboard under Settings → Advanced → Security → Client token.Add a URL scheme
The SDK uses a custom URL scheme to return users to your app after they authenticate with Facebook.In Xcode, go to your target’s Info tab, expand URL Types, and add a new entry:
- Identifier:
$(PRODUCT_BUNDLE_IDENTIFIER) - URL Schemes:
fbYOUR_APP_ID(for example,fb1234567890)
Info.plist this looks like:Initialize the SDK in your AppDelegate
Call
ApplicationDelegate.shared.application(_:didFinishLaunchingWithOptions:) from your app delegate so the SDK can initialize itself, restore cached tokens, and handle incoming URLs from the Facebook app.