文档已更新。
中文(简体) 译文尚未完成。
英语更新时间:4月14日
中文(简体) 更新时间:2022年4月20日

Component SDKs of the Facebook SDK for Android

The Facebook SDK for Android consists of the following component SDKs:

If you don't need the functionality of the full Facebook SDK for Android, you can save space by using only the component SDKs that you need to support the Facebook products that you want to use in your app.

使用 Facebook SDK 时,如果您未禁用自动记录事件功能,系统会自动记录和收集应用中的部分事件。如要详细了解系统会收集哪些信息以及如何禁用自动记录事件功能,请参阅自动记录应用事件

To link with Maven to one of the component SDKs in your project, add one of the following implementation statements to your build script:

  • implementation 'com.facebook.android:facebook-applinks:latest.release'
  • implementation 'com.facebook.android:facebook-common:latest.release'
  • implementation 'com.facebook.android:facebook-core:latest.release'
  • implementation 'com.facebook.android:facebook-gamingservices:latest.release'
  • implementation 'com.facebook.android:facebook-login:latest.release'
  • implementation 'com.facebook.android:facebook-messenger:latest.release'
  • implementation 'com.facebook.android:facebook-share:latest.release'

To add an implementation statement:

  1. In your project, open your_app | Gradle Scripts | build.gradle (Project) and add the following repository to the buildscript { repositories {}} section to download the SDK from the Maven Central Repository:
    mavenCentral() 
  2. In your project, open your_app | Gradle Scripts | build.gradle (Module: app) and add one or more of the implementation statements to the dependencies{} section.
  3. Build your project.

Download

You can also download the entire Facebook SDK for Android.

See facebook/facebook-android-sdk on GitHub.