Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit

Summary: Add null check for context to avoid null pointer exception

Reviewed By: wx0165927473

Differential Revision: D46267418

fbshipit-source-id: 89d260327c29973c7dfb8759b28f4d15fdf4dfd4

Git stats


Failed to load latest commit information.
Latest commit message
Commit time
October 26, 2021 12:49
November 14, 2022 09:58
March 22, 2023 15:22
November 20, 2019 17:29
July 13, 2016 13:09

Facebook SDK for Android

Run testsuite with gradle Maven Central

This library allows you to integrate Facebook into your Android app.

Learn more about the provided samples, documentation, integrating the SDK into your app, accessing source code, and more at

👋 The SDK team is eager to learn from you! Fill out this survey to tell us what’s most important to you and how we can improve.


  1. Check-out the tutorials available online at
  2. Start coding! Visit for tutorials and reference documentation.



The SDK is separated into modules with the following structure.

|                                                    |
| Facebook-android-sdk                               |
|                                                    |
+----------+ +----------+ +------------+ +-----------+
|          | |          | |            | |           |
| Facebook | | Facebook | | Facebook   | | Facebook  |
| -Login : | | -Share   | | -Messenger | | -Applinks |
|          | |          | |            | |           |
+----------+ +----------+ |            | |           |
+-----------------------+ |            | |           |
|                       | |            | |           |
| Facebook-Common       | |            | |           |
|                       | |            | |           |
+-----------------------+ +------------+ +-----------+
|                                                    |
| Facebook-Core                                      |
|                                                    |


Facebook SDKs are broken up into separate modules as shown above. To ensure the most optimized use of space only install the modules that you intend to use. To get started, see the Installation section below.

Any Facebook SDK initialization must occur only in the main process of the app. Use of Facebook SDK in processes other than the main process is not supported and will likely cause problems.


Facebook SDKs are published to Maven as independent modules. To utilize a feature listed above include the appropriate dependency (or dependencies) listed below in your app/build.gradle file.

dependencies {
    // Facebook Core only (Analytics)
    implementation ''

    // Facebook Login only
    implementation ''

    // Facebook Share only
    implementation ''

    // Facebook Messenger only
    implementation ''

    // Facebook App Links only
    implementation ''
    // Facebook Marketing only
    implementation ''

    // Facebook Android SDK (everything)
    implementation ''

You may also need to add the following to your project/build.gradle file.

buildscript {
    repositories {


Please report bugs or issues to

You can also visit our Facebook Developer Community Forum, join the Facebook Developers Group on Facebook, ask questions on Stack Overflow, or open an issue in this repository.


See the SECURITY POLICY for more info on our bug bounty program.


We are able to accept contributions to the Facebook SDK for Android. To contribute please do the following.

  • Follow the instructions in the
  • Submit your pull request to the main branch. This allows us to merge your change into our internal main and then push out the change in the next release.


Except as otherwise noted, the Facebook SDK for Android is licensed under the Facebook Platform License (

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


  • By enabling Facebook integrations, including through this SDK, you can share information with Facebook, including information about people’s use of your app. Facebook will use information received in accordance with our Data Use Policy (, including to provide you with insights about the effectiveness of your ads and the use of your app. These integrations also enable us and our partners to serve ads on and off Facebook.

  • You may limit your sharing of information with us by updating the Insights control in the developer tool ([app_id]/settings/advanced).

  • If you use a Facebook integration, including to share information with us, you agree and confirm that you have provided appropriate and sufficiently prominent notice to and obtained the appropriate consent from your users regarding such collection, use, and disclosure (including, at a minimum, through your privacy policy). You further agree that you will not share information with us about children under the age of 13.

  • You agree to comply with all applicable laws and regulations and also agree to our Terms (, including our Platform Policies ( and Advertising Guidelines, as applicable (

By using the Facebook SDK for Android you agree to these terms.