Skip to main content

Prerequisites

Before setting up the iOS SDK, ensure you have:
  • Completed the Facebook App Setup (steps 2, 3, and 4)
  • Added the library via npm/yarn
  • Run pod install in your ios/ directory

Installation

1

Install CocoaPods dependencies

After installing the npm package, navigate to your iOS directory and install pods:
2

Configure Info.plist

Add your Facebook App ID, Display Name, and other required keys to ios/Info.plist:
3

Add App Tracking Transparency permission

For iOS 14+, add the App Tracking Transparency usage description:
4

Configure AppDelegate

The configuration differs based on your React Native version:

AppDelegate Configuration

Since React Native 0.77, Swift is natively supported. Configure AppDelegate.swift:

1. Add Required Imports

2. Initialize Facebook SDK

Add this to your didFinishLaunchingWithOptions method:

3. Add openURL Method for Facebook SSO

This method is required for Facebook login to work when the Facebook app is installed on the device.

4. (Optional) Activate App When It Becomes Active

With Deep Linking (RCTLinkingManager)

If you’re using React Native’s deep linking, modify the openURL method:
The order is critical: FBSDKApplicationDelegate must be checked before RCTLinkingManager. If RCTLinkingManager is placed first, it will intercept the Facebook SSO callback URL and treat it as a regular deep link, breaking Facebook Single Sign-On functionality.

Troubleshooting

Undefined symbols for architecture error

If you encounter a build error with “Undefined symbols for architecture x86_64”, you need to create a Bridging Header.
After facebook-ios-sdk v7 (written with Swift), you need to coordinate Swift language usage with Objective-C: Solution 1: Create a Bridging Header (Recommended)
  1. Create a new file named File.swift in your main project folder
  2. When Xcode prompts you, click “Yes” to create a Bridging Header
  3. The empty Swift file will automatically configure the Header Search Paths
Solution 2: Add Podfile Workaround Add this to the post_install section of your Podfile:
Then run:

Login doesn’t work when Facebook app is installed

Make sure you’ve implemented the openURL method correctly. Without it, the Facebook app cannot redirect back to your app after authentication. See: GitHub Issue #59

App ID not found error

If you get an exception about App ID not found, and you’re certain it’s in your Info.plist, add this to didFinishLaunchingWithOptions before the return YES statement:

Duplicate symbol errors

Make sure that FBSDKCoreKit.framework, FBSDKLoginKit.framework, and FBSDKShareKit.framework are not in Link Binary with Libraries for your root project when using CocoaPods.

Xcode version too old

If you get the error no type or protocol named UIApplicationOpenURLOptionsKey, upgrade to Xcode 10.0 or later.

Next Steps

Once iOS setup is complete, you can: