Render Unified Ad (Only for GAM)
1
2
Call loadAd() method as per the below format
loadAd() method as per the below formatAdSterAdLoader.Companion.builder().withAdsListener(new MediationAdListener() {
@Override
public void onBannerAdLoaded(@NonNull MediationBannerAd ad) {
super.onBannerAdLoaded(ad);
//Show banner ad here
}
@Override
public void onNativeAdLoaded(@NonNull MediationNativeAd ad) {
super.onNativeAdLoaded(ad);
//Show native ad here
}
@Override
public void onNativeCustomFormatAdLoaded(@NonNull MediationNativeCustomFormatAd ad) {
super.onNativeCustomFormatAdLoaded(ad);
//Show native custom format ad here
}
@Override
public void onFailure(@NonNull AdError adError) {
//Handle failure callback here
}
}).withAdsEventsListener(new AdEventsListener() {
@Override
public void onAdClicked() {
//Handle ad click here
}
@Override
public void onAdImpression() {
//Handle ad impression here
}
@Override
public void onAdRevenuePaid(double revenue, @NotNull String adUnitId, @NotNull String network) {
// Callback which provides revenue and the network which provided it
}
}).build().loadAd(configuration.build());