Facebook sdk build android

Getting Started with the Facebook SDK for Unity on Android

Note: This guide is organized to follow after the shared setup steps for the Facebook SDK for Unity detailed in the Getting Stared guide. If you have not yet completed these steps please do so first.

This document provides an follow up step-by-step guide to get started with the Facebook SDK for Unity on Android. We will build and deploy the sample Unity app bundled with the Unity SDK to allow you to get working on a Facebook integration quickly and effectively. If you’re more comfortable working on iOS or Web, you can switch to the Getting Started guides for those platforms.

Configuring your app for Android

Step 1: Switch to the Android Platform

Go to the Unity Editor. From the menu, choose ‘File’, ‘Build Settings…’ In the Build Settings dialog, under ‘Platform’, select ‘Android’ as the target and click ‘Switch Platform’. Ensure the sample project scenes have been added to the ‘Scenes in Build’ as previously described here.

Step 2: Set Android Miniimum API Level

Click on Player Settings and make sure the android Minimum API level is set to «Android 4.0.3 ‘Ice Cream Sandwich’ (API level 15)» or higher.

Step 3: Configure Bundle ID and Key Hash

With the Build Settings dialog still open, click ‘Player Settings. ‘ Then, in the Inspector pane go to ‘Settings for Android’, then ‘Other Settings’. Fill in the ‘Bundle Identifier’ field with a valid bundle identifier, usually formed using your company name and product name. Save your project.

Now select ‘Edit Settings’ from the ‘Facebook’ menu.

Find and note the value of the ‘Debug Android Key Hash’ in the ‘Android Build Facebook Settings’ panel. Also note the value of the ‘Class Name’.

Now, let’s add the Bundle ID, Key Hash, and Class Name to your app’s Facebook settings. Go to the ‘Android’ pane in the Basic tab of your app’s ‘Settings’ page, and fill in the ‘Bundle ID’, ‘Key Hashes’ , and ‘Class Name’ fields. Now save your changes.

Now, back in the Unity Editor, click the ‘Build’ button. When prompted for an output directory name, call it unity_android . You can choose to export an APK file directly, which you can install on a test device, or to export a project file to be opened in your Android IDE.

Now you’re up and running on Android. Congratulations!

Next steps

Feel free to explore the sample app to try out the various features of the SDK. Start by clicking the FB.Init button at the top of the sample, which will enable the other features of the sample. As a next step, modify the code included in the sample and add it to your game project; this will get your Facebook integration off to a flying start.

For more details on integrating the Facebook SDK into your Unity game, check out the SDK reference and SDK Examples. And if you’d like to see how easy it is to deploy to Facebook Canvas and iOS, check out their respective Getting Started guides.

Читайте также:  Hotline miami android вылетает

Источник

Facebook sdk build android

Facebook SDK for Android

This open-source 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 https://developers.facebook.com/docs/android

  1. Check-out the tutorials available online at https://developers.facebook.com/docs/android/getting-started
  2. Start coding! Visit https://developers.facebook.com/docs/android/ for tutorials and reference documentation.

The SDK is separated into modules with the following structure.

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.

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

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 CONTRIBUTING.md.
  • 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 (https://github.com/facebook/facebook-android-sdk/blob/main/LICENSE.txt).

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 (https://www.facebook.com/about/privacy/), 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 (https://developers.facebook.com/apps/[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 (https://www.facebook.com/policies/), including our Platform Policies (https://developers.facebook.com/policy/) and Advertising Guidelines, as applicable (https://www.facebook.com/ad_guidelines.php).

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

Читайте также:  Архиватор zip для андроид 4pda

Источник

Facebook SDK for Android

This documentation describes how to integrate your Android app with Facebook to build engaging social apps by using the Facebook SDK for Android. To learn more about using Facebook development tools, see App Development.

The current version of the Facebook SDK for Android is version 12.0.0 and requires the Android API 15. Code and samples for the Facebook SDK for Android are available on GitHub.

Beginning with SDK v13.0, set to release in early 2022, a Client Token will be required for all calls to the Graph API.

When you use the Facebook SDK for Android, follow the Facebook Open Source Terms of Use and Privacy Policy.

Common Uses

The Facebook SDK for Android gives you access to the following features:

Facebook Login — A secure and convenient way for people to log into your app or website by using their Facebook credentials.

Sharing — Enable people to post to Facebook from your app. People can share, send a message, and share to stories.

App Events — Understand people’s actions in your app and measure the effectiveness of your Mobile App Ads.

Graph API — Get data in and out of Facebook’s social graph, query data, post stories, upload photos and perform other tasks.

Advertise Your App — Drive installs of your app by using Mobile App Install Ads. Increase engagement with your app by using Mobile App Engagement Ads. Find your target audience with Custom Audiences for Mobile Apps.

Documentation Contents

Component SDKs

Describes the component SDKs of the Facebook SDK for Android.

Getting Started

A short tutorial to get you up and running.

Calling the Graph API from Android

Learn how to call the Facebook Graph API from your Android app.

FAQ & Troubleshooting

Frequently asked questions and troubleshooting information for the Facebook SDK for Android.

Changelog

Changelog and release notes for the Facebook SDK for Android.

Upgrade Guide

Instructions for upgrading your version of the Facebook SDK for Android.

Devices

Considerations when you use the Facebook SDK for Android with Android TV and Amazon’s Fire TV.

Reference

Component and endpoint references.

Downloads

Instructions to reference the Facebook SDK for Android in your app and links to download old versions.

Deprecated

Resources for old versions of the Facebook SDK for Android.

Источник

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.

When you use the Facebook SDK, some events in your app are automatically logged and collected unless you disable automatic event logging. For details about what information is collected and how to disable automatic event logging, see Automatic App Event Logging.

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:

    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:

Download

You can also download the entire Facebook SDK for Android.

Читайте также:  Универсальный андроид для старых планшетов

Источник

Get Started with Android

Audience Network is now bidding only

Audience Network is now only using bidding to fill ads in iOS and Android apps. You’ll need to move your apps from waterfall to bidding to monetize with Audience Network.

Facebook Audience Network allows you to monetize your Android apps with Facebook ads. This guide will walk you through all the steps to integrate the SDK.

Prerequisites

Минимальную версию ОС, которую поддерживает Audience Network SDK, см. в разделе ЧаВо.

Step 1: Creating a New Project

Step 2: Including the SDK

Step 3: Integration Error Mode (optional)

Step 1: Creating a New Project

You can skip this step if you already have a project you want to integrate Audience Network into.

Start Android Studio and select «Start a new Android Studio Project»

Name your project and specify your company’s domain.
The Package name will be your identifier if you decide to upload your app to the Google Play store.

Set your minimum Android SDK version. Audience Network requires API 15 or higher, but for the sake of
these samples, we will use API 21 .

Add an Empty Activity to your Project

Name your initial Activity and click Finish.

Step 2: Including the SDK

The Audience Network SDK is part of the Facebook SDK. Follow these steps to download and include it in your project:

Using Gradle

Add the following compile statement to your app-level build.gradle (not project!), to use the latest Audience Network SDK:

If there are issues resolving the Audience Network SDK, make sure that you’ve synced your Gradle file and try restarting Android Studio.

Manual installation (Not Recommended)

If using Intellij IDEA or Eclipse, download and extract the Audience Network SDK for Android. Under the AudienceNetwork/bin folder, copy the AudienceNetwork.aar file and place it in the /libs folder in your project you might need to create the directory if it doesn’t already exist. Then, add the following lines to your app’s build.gradle:

If using AudienceNetwork.jar for your project, under the AudienceNetwork/bin folder, rename the AudienceNetwork.aar to AudienceNetwork.zip , extract classes.jar file and rename it to AudienceNetwork.jar , place the AudienceNetwork.jar file in the /libs folder in your project you might need to create the directory if it doesn’t already exist. Make sure your IDE’s UI reflects this change. If you are using Intellij IDEA or Eclipse, right click on the libs/AudienceNetwork.jar file and choose ‘Add as Library’.

Though not required, we recommend that you set up your project to work with Google Play Services as indicated here. This will enable the Audience Network SDK to fetch the Advertising ID more efficiently.

Step 3: Integration Error Mode (optional)

When integrating the Audience Network SDK, the integration error mode setting can be used to verify that your integration is working as intended. Specifically, this method allows you to control the SDK’s behavior when used incorrectly .

  • INTEGRATION_ERROR_CRASH_DEBUG_MODE : App will crash if your build has Android FLAG_DEBUGGABLE, otherwise INTEGRATION_ERROR_CALLBACK_MODE will be used (recommended when testing).
  • INTEGRATION_ERROR_CALLBACK_MODE : App will call AdListener.onError(Ad, AdError) callback if an integration error is discovered.

Next Steps

Relevant code samples in both Swift and Objective-C are available on our GitHub sample app respository

As soon as we receive a request for an ad from your app or website, we’ll review it to make sure it complies with Audience Network policies and the Facebook community standards

Источник

Оцените статью