Bensal
Bensal

Reputation: 4110

What are the changes needed to be done on flutter project to add Facebook Audience Network through Admob Mediation?

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.

Upvotes: 0

Views: 339

Answers (2)

Bensal
Bensal

Reputation: 4110

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.

Upvotes: 0

Rohan Das
Rohan Das

Reputation: 556

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>

Upvotes: 3

Related Questions