0

Recently we have received a warning from Facebook regarding to showing ads with APKs that are side-loaded or installed from anywhere but Google Play Store. We'd like to disable Facebook mediation on those users while still keep showing ads to our users that have installed the app from Google Play Store.

I've searched Admob's documentation about how to disable the mediation networks and come across something like this:

public void initializeAdNetworks()
{
    MobileAds.disableMediationAdapterInitialization(this);
    MobileAds.initialize(this);

    PackageManager manager = getPackageManager();
    List<String> validPackages = Arrays.asList("com.google.android.feedback", "com.android.vending");

    if (manager == null || validPackages.contains(manager.getInstallerPackageName(getPackageName())))
        MobileAds.registerRtbAdapter(FacebookAdapter.class);
}

I've also disabled automatic initialization for ad networks by overriding its content provider:

<provider
    android:name="com.google.android.gms.ads.MobileAdsInitProvider"
    android:authorities="${applicationId}.mobileadsinitprovider"
    android:exported="false"
    android:initOrder="100" 
    android:enabled="false" />

And this is roughly how I make a request:

interstitialAd = new InterstitialAd(this, adId);
interstitialAd.loadAd(new AdRequest.Builder().build());

However, I can still see Facebook ads even though after debugging I see facebook adapter is not initialized (supposedly).

What should I do in this case? Thank you for your help.

Furkan Yurdakul
  • 2,801
  • 1
  • 15
  • 37
  • Hi. Did you find a solution to your problem? I have the same report for google. Thank you – Thomas Thomas Dec 11 '20 at 14:14
  • @ThomasThomas Hello. We ended up using LVL and using two separate advertisement IDs to request ads, one is configured with Facebook and one isn't configured with Facebook. Other than that, we couldn't find any other solutions. – Furkan Yurdakul Dec 12 '20 at 16:22

0 Answers0