Skip to main content

Facebook SDK for React Native

Build engaging mobile experiences with Facebook Login, sharing, analytics, and Graph API integration. Works seamlessly on iOS and Android.

Quick Start

Get up and running with Facebook SDK in your React Native app in minutes

1

Install the package

Add react-native-fbsdk-next to your project using your preferred package manager.
npm install react-native-fbsdk-next
For iOS, run cd ios && pod install to install the native dependencies.
2

Configure your Facebook App

Set up a Facebook App in the Facebook Developer Portal and configure your iOS and Android platforms with bundle IDs and key hashes.Follow the platform-specific setup guides for iOS, Android, or Expo.
3

Initialize the SDK

Initialize the Facebook SDK in your app. For iOS 14+, this is required to comply with Apple privacy requirements.
import { Settings } from 'react-native-fbsdk-next';

// Initialize SDK as early as possible
Settings.initializeSDK();
4

Add Facebook Login

Implement Facebook Login using the LoginButton component or LoginManager for custom UI.
import { LoginButton, AccessToken } from 'react-native-fbsdk-next';

<LoginButton
  onLoginFinished={(error, result) => {
    if (error) {
      console.log("Login error: " + error);
    } else if (result.isCancelled) {
      console.log("Login cancelled");
    } else {
      AccessToken.getCurrentAccessToken().then(data => {
        console.log("Access token: " + data.accessToken);
      });
    }
  }}
/>

Explore Features

Discover everything you can build with React Native FBSDK Next

Facebook Login

Implement secure user authentication with Facebook Login and Limited Login support

Content Sharing

Enable users to share photos, videos, and links to Facebook with ShareDialog

App Events

Track user actions and conversions with Facebook Analytics

Graph API

Access Facebook data and perform operations using the Graph API

User Profiles

Retrieve and manage user profile information

Game Requests

Send game invitations and requests to Facebook friends

Ready to integrate Facebook?

Start building engaging social experiences with Facebook Login, sharing, and analytics

Start Building

Build docs developers (and LLMs) love