Bidapp Ads
  • 🎁Ab_dout
  • Integration
    • iOS
      • Getting started
      • Additional Settings
      • App Policy Settings
      • Serverless Settings
      • Interstitial Ads
      • Rewarded Ads
      • Banner Ads
      • SKAdNetwork
      • SwiftUI
    • Android
      • Getting started
      • Additional Settings
      • App Policy Settings
      • Serverless Settings
      • Interstitial Ads
      • Rewarded Ads
      • Banner Ads
      • Jetpack Compose
  • PLUGINS
    • Kotlin Multiplatform
      • Getting started
      • Android Platform Setup
      • iOS Platfrom Setup
      • App Policy Settings
      • Interstitial Ads
      • Rewarded Ads
      • Banner Ads
    • Unreal Engine
      • Getting started
      • App Policy Settings
      • Interstitial Ads
      • Rewarded Ads
      • Banner Ads
      • MREC
    • Unity
      • Getting started
      • Android
      • iOS
      • App Policy Settings
      • Interstitial Ads
      • Rewarded Ads
      • Banner Ads
Powered by GitBook
On this page
  • Showing a Rewarded Ad
  • Stopping and Starting Auto-Load

Was this helpful?

  1. Integration
  2. Android

Rewarded Ads

Rewarded Ads are loaded automatically. You can observe ad loading events by specifying the delegate:

Rewarded rewarded = new Rewarded(this);
rewarded.setLoadDelegate(this);

val rewarded: Rewarded? = Rewarded(this)
rewarded.setLoadDelegate(loadDelegate)

The delegate should implement the following methods:

@Override
public void didLoad(AdInfo adInfo) {
    print("Rewarded - didLoadAd. AdInfo: " + adInfo) 
}

@Override
public void didFailToLoad(AdInfo adInfo, Error error) {
    print("Rewarded - didFailToLoadAd. AdInfo:" + adInfo + " Error: " + error.getLocalizedMessage()) 
}
override fun didLoad(adInfo: AdInfo?) {
    print("Rewarded - didLoadAd. AdInfo: $adInfo") 
}

override fun didFailToLoad(adInfo: AdInfo?, error: Error) {
    print("Rewarded - didFailToLoadAd. AdInfo: $adInfo. Error: ${error.getLocalizedMessage()}") 
}

Showing a Rewarded Ad

To show a rewarded ad, call showWithDelegate method of the Rewarded class:

rewarded.showWithDelegate(Activity, showDelegate);
rewarded.showWithDelegate(Activity, showDelegate)

The delegate should implement the following methods:

@Override
public void didDisplayAd(AdInfo adInfo) {
    System.out.println ("Rewarded - didDisplayAd. AdInfo:" + adInfo) 
}

@Override
public void didClickAd(AdInfo adInfo) {
    System.out.println("Rewarded - didDisplayAd. AdInfo:" + adInfo );
}

@Override
public void didHideAd(AdInfo adInfo) {
    System.out.println("Rewarded - didHideAd. AdInfo:" + adInfo );
}

@Override
public void didFailToDisplayAd(AdInfo adInfo, Error error) {
    System.out.println("Rewarded - didFail toDisplayAd. AdInfo:" + adInfo + error.getLocalizedMessage());
}

@Override
public void allNetworksDidFailToDisplayAd() {
    System.out.println("Rewarded - allNetworksDidFailToDisplayAd.");
}

@Override
public void didRewardUser() {
    System.out.println("Rewarded - didRewardUser");
}
override fun didDisplayAd(adInfo: AdInfo?) {
    print("Rewarded - didDisplayAd. AdInfo: $adInfo")
}

override fun didClickAd(adInfo: AdInfo?) {
    print("Rewarded - didClickAd. AdInfo: $adInfo")
}

override fun didHideAd(adInfo: AdInfo?) {
    print("Rewarded - didHideAd. AdInfo: $adInfo")
}

override fun didFailToDisplayAd(adInfo: AdInfo?, error: Error) {
    print("Rewarded - didFail toDisplayAd. AdInfo: $adInfo. Error: ${error.getLocalizedMessage()}")
}

override fun allNetworksDidFailToDisplayAd() {
    print("Rewarded - allNetworksDidFailToDisplayAd." )
}

override fun didRewardUser() {
    print("Rewarded - didRewardUser")
}

Stopping and Starting Auto-Load

By default, Rewarded preload ads before any manual load attempt. So a Rewarded can use already preloaded ads instead of waiting on a manual load call to load new ads. To disable this feature you need to call the following method:

rewarded.setAutoload(false);
rewarded.setAutoload(false)

Once you disable autoload, you should load ads manually every time you need them to show:

rewarded.load();
rewarded.load()
PreviousInterstitial AdsNextBanner Ads

Last updated 11 months ago

Was this helpful?