I had this on the project, to handle Facebook ads via Admob:
implementation 'com.google.ads.mediation:facebook:6.11.0.0'
And in code:
final AdRequest.Builder builder = new AdRequest.Builder();
builder.addNetworkExtrasBundle(FacebookAdapter.class, new FacebookExtras().setNativeBanner(true).build());
adLoader.loadAd(builder.build());
It works fine.
Now when updating to the new version (originally I asked about 6.12.0) :
implementation 'com.google.ads.mediation:facebook:6.14.0'
It shows that both FacebookAdapter and FacebookExtras don't exist anymore.
Checking on the docs, even though they say to use this version, the code they tell to use is the same as before:
Bundle extras = new FacebookExtras()
.setNativeBanner(true)
.build();
AdManagerAdRequest request = new AdManagerAdRequest.Builder()
.addNetworkExtrasBundle(FacebookAdapter.class, extras)
.build();
EDIT: someone wrote that I should use this, but without any explanation of where he got this from, and I also failed to find the origin of it:
I tried to ask some questions about it, but then it got removed.
EDIT: It seems that the old instructions are now completely gone.
So perhaps it's not needed anymore:
Then again, they still mention there the class that doesn't exist anymore : FacebookAdapter .
I tried to just update the dependency and remove the code that can't be used, but then I got this error while loading the native ad:
error code 3 - Unable to instantiate mediation adapter class.
What should I use instead? How come it's not documented?
I think the documentation only added more information logs, and that now the minimal that we need is just to have the dependencies and that's it.
If I'm wrong, please let me know.
Sadly though, I still have the error, but I think the reason is something on the website/s (Facebook and/or Admob).
EDIT: I think I had this missing in manifest, and as the project has it shared between 2 apps, one of them didn't have it:
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="@string/ad_mob_app_id" />
Now I think it works fine.