If you miss to Initialize the SDK, this method will fail to return a response.
To implement an Interstitial bidder object for GAM follow:
val mesonGAMInterstitial = MesonGAMInterstitial("<Adunit Id>")
MesonGAMInterstitial mesonGAMInterstitial = new MesonGAMInterstitial("<Adunit Id");
To fetch a bid for GAM follow:
//Fetch bid by supplying publisher created DFP's AdManagerAdRequestBuilder instance
mesonGAMInterstitial.fetchBid(pubInstance, object : MesonAdFetchListener<AdManagerAdRequest.Builder> {
override fun onComplete(obj: AdManagerAdRequest.Builder, error: Error?) {
val adManagerAdRequest = obj.build()
//Load with publisher created dfpInterstitial instance
dfpInterstitial.loadAd(adManagerAdRequest)
}
})
//Fetch bid by supplying publisher created DFP's AdManagerAdRequestBuilder instance
mesonGAMInterstitial.fetchBid(pubInstance, new MesonAdFetchListener<AdManagerAdRequest.Builder>() {
@Override
public void onComplete(AdManagerAdRequest.Builder obj, @Nullable Error error) {
AdManagerAdRequest adManagerAdRequest = obj.build();
//Load with publisher created dfpInterstitial instance
dfpInterstitial.loadAd(adManagerAdRequest);
}
});
Next, let's Manage Demand and Configure your Ad Server.