SDK Implementation Guide
  • 📱SDK Implementation Guide
  • How to Configure
    • 💡Initialising the SDK
  • How to Render an Ad
    • 📪Banner Ad
    • 📪Interstitial Ad
    • 📪Rewarded Ad
    • 📪Native Ad
    • 📪Custom Native Ad
  • Beta Ad Format's
    • 🎨App open (Beta)
    • 🎨In-stream Video (Beta)
  • Feature's only for GAM
    • 🎨Adaptive Banner Ad (Only for GAM)
    • 🎨Render Unified Ad (Only for GAM)
    • 🎨How to pass predefined custom targeting values in ad request (Only for GAM)
    • 🎨How to pass publisher provided identifiers in ad request (PPID) (Only for GAM)
    • TEST AD UNITS
  • Manifest Changes Required for SDK
  • Integrate Ads & APP Ads For Easy Management
Powered by GitBook
On this page

Was this helpful?

  1. Feature's only for GAM

Render Unified Ad (Only for GAM)

Below are the steps to load and render a unified ad on your app

  1. Create your AdRequestConfiguration as per the below format

val configuration = AdRequestConfiguration.Companion.builder(context, "Your_placement_name");
  1. Call loadAd() method as per the below format

AdSterAdLoader.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
    }
}).build().loadAd(configuration.build());
AdSterAdLoader.builder().withAdsListener(object : MediationAdListener() {
    override fun onBannerAdLoaded(ad: MediationBannerAd) {
        super.onBannerAdLoaded(ad)
        //Show banner ad here
    }

    override fun onNativeAdLoaded(ad: MediationNativeAd) {
        super.onNativeAdLoaded(ad)
        //Show native ad here
    }

    override fun onNativeCustomFormatAdLoaded(ad: MediationNativeCustomFormatAd) {
        super.onNativeCustomFormatAdLoaded(ad)
        //Show native custom format ad here
    }

    override fun onFailure(adError: AdError) {
        //Handle failure callback here
    }
}).withAdsEventsListener(object : AdEventsListener() {
    override fun onAdClicked() {
        //Handle ad click here
    }

    override fun onAdImpression() {
        //Handle ad impression here
    }
}).build().loadAd(configuration.build())
PreviousAdaptive Banner Ad (Only for GAM)NextHow to pass predefined custom targeting values in ad request (Only for GAM)

Last updated 1 year ago

Was this helpful?

onNativeAdLoaded() - for Rendering implementation onBannerAdLoaded() - for Rendering implementation onNativeCustomFormatAdLoaded() - for Rendering implementation

🎨
Click here
Click here
Click here