0

I could not find enough information on the web on merging Facebook Audience Network through Admob Mediation in flutter. Can someone guide me in the changes needed to be done in the project after setting Mediation in Admob.

The changes that need to be clear are :

  1. What are the dependencies I should add excluding admob_flutter?
  2. What are the implementations that should be added to the build.gradle?
  3. Are there anything to be done on any other folders?

It would be nice if there was an explanation for the IOS project too.

Bensal
  • 3,316
  • 1
  • 23
  • 35
  • 1
    Does this answer your question? [In flutter, how to integrate facebook audience as mediation network with Admob?](https://stackoverflow.com/questions/61427424/in-flutter-how-to-integrate-facebook-audience-as-mediation-network-with-admob) – Emile Jul 20 '21 at 09:34
  • @Emile Almost, but not completely – Bensal Jul 21 '21 at 09:50

2 Answers2

3

Facebook Audience Network SDK in the app-level build.gradle file.

repositories {
    google()
    mavenCentral()
}

...
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.gms:play-services-ads:20.2.0'
    implementation 'com.google.ads.mediation:facebook:6.5.1.0'
}
...

Then, add a Network Security Configuration File

location :- res/xml/network_security_config.xml

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    ...
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true">127.0.0.1</domain>
    </domain-config>
    ...
</network-security-config>

Then in your application manifest AndroidManifest.xml, add the configuration to your application attribute as follows:

<?xml version="1.0" encoding="utf-8"?>
<manifest ... >
    <application android:networkSecurityConfig="@xml/network_security_config"
    ... >
    ...
    </application>
</manifest>
Røhäñ Dås
  • 528
  • 4
  • 13
  • Thankyou for the answer, Can you be clear on network_security_config, is it mandatory – Bensal Jul 23 '21 at 04:56
  • 1
    According to integration of facebook audience network with mediation guide explained by google developers is to modify your network security config file to support media caching. – Røhäñ Dås Jul 23 '21 at 12:19
0

I have successfully enabled it by just adding the SDK to the app-level build.gradle file.

dependencies {
    ...
    implementation 'com.google.android.gms:play-services-ads:20.2.0'
    implementation 'com.google.ads.mediation:facebook:6.5.1.0'
}

After that i tested it using mediation_test package.

Bensal
  • 3,316
  • 1
  • 23
  • 35