Facebook Aggregation Guide - uc-union/union-ads-sdk-demo GitHub Wiki

Facebook Aggregation Guide


Introduction

For more details please go to Facebook website

Integration Guide

Android Studio (Highly recommended)

Add repositories info to build.gradle

repositories {
    mavenCentral()
}

Add dependencies Dependency

dependencies {
    'com.facebook.android:audience-network-sdk:4.+'
}

For more details: build.gradle & app/build.gradle

Add the following contents to AndroidManifest.xml

<application android:label="@string/app_name">
    ...
    <activity android:name="com.facebook.ads.InterstitialAdActivity"
        android:configChanges="keyboardHidden|orientation|screenSize" />
</application>

For more details: AndroidManifest.xml

Eclipse

Note: If you use Android Studio,you can skip this section.

Download the corresponding SDK from official Facebook site Download Page

Note:New Facebook SDK uses aar format

Decompress AudienceNetwork.aar locally,you'll get the following directory structure.

AudienceNetwork.aar
    |--(Directories)
    |--AndroidManifest.xml
    |--proguard.txt
    |--classes.jar

Follow the steps below,

  1. Rename classes.jar and put it in the libs directory

  2. Merge the content of proguard.txt into proguard.pro of the developer's project.

  3. Add the following content to AndroidManifest.xml

    <!-- Include required permissions -->
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    
    <application android:label="@string/app_name">
        ...
        <activity android:name="com.facebook.ads.InterstitialAdActivity"
            android:configChanges="keyboardHidden|orientation|screenSize" />
    </application>
⚠️ **GitHub.com Fallback** ⚠️