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.