AATKit Android Integration
Release Notes
  • Start
    • Setup
      • Maven
      • Prerequisites
      • Google Family Safe Apps
    • Initialization
    • Consent
      • General Handling
      • Managed Consent
        • Google CMP
        • Sourcepoint CMP
        • SFBX (AppConsent) CMP
      • Vendor Consent
      • Simple Consent
    • Plugins documentation
    • Additional Information
  • Formats
    • Introduction
    • Banner
      • Auto Load Banner
      • Multi-Size Auto Load Banner
      • Banner Cache
      • Infeed Banner
      • Sticky Banner
      • Multi-Size Banner
    • Fullscreen (Interstitial)
    • AppOpen (Google)
    • Rewarded Video
      • Server-Side Verification (SSV)
    • Native Ad
      • Basic Integration
      • Network Specifics
        • Native Ads: Google
        • Native Ads: ApplovinMax
        • Native Ads: Bluestack
        • Native Ads: FacebookAudienceNetwork
        • Native Ads: Huawei
  • Ad Networks
    • Customize Ad Networks
    • Google Mobile Ads SDK
    • AppLovinMax Ad Review
    • AppNexus special settings
    • FeedAd Shutter Colour and Disabling Spinner
    • Kidoz
  • Advanced
    • Targeting
      • Key-Value Targeting
      • User Targeting
      • Content Targeting URL
    • Frequency Capping
    • Advanced Listeners
      • Reports Delegate
      • Impression Listener (ILRD)
      • Statistics Listener
    • AATKit's Size
    • Ad Space and Fill Rate
    • Shake Debug
    • Child-directed Support
    • Geo Tracking
    • Disabling Ad Networks
    • Huawei Support
    • Creatives History
  • Other
    • AdMob Custom Events
    • Reference
      • Classes
        • AATKit
        • AATKitUserTargeting
        • CollapsibleBannerOptions
        • AATKitDebugScreenConfiguration
        • PlacementDebugInfo
        • AATKitDebugInfo
        • AATKitConfiguration
        • AATKitRuntimeConfiguration
        • ManagedConsent
        • VendorConsent
        • SimpleConsent
        • BannerConfiguration
        • BannerRequest
        • BannerCacheConfiguration
        • AATKitReward
        • NativeAdRating
        • AATKitImpression
        • PriceInfo
        • AdInfo
        • RewardedAdSSVInfo
        • PlacementHistoryInfo
        • AATKitAdNetworkOptions
          • SuperAwesomeOptions
          • FeedAdOptions
          • AppNexusOptions
          • AdMobOptions
          • DFPOptions
      • Interfaces
        • CacheStatusDelegate
        • AATKit.Delegate
        • BannerCache
        • BannerRequestCompletionListener
        • ManagedConsentDelegate
        • VendorConsentDelegate
        • Placement
        • StickyBannerPlacement
        • StickyBannerPlacementListener
        • MultiSizeBannerPlacement
        • MultiSizeBannerPlacementListener
        • InfeedBannerPlacement
        • InfeedBannerPlacementListener
        • BannerRequestDelegate
        • CacheDelegate
        • FullscreenPlacement
        • FullscreenPlacementListener
        • AppOpenAdPlacement
        • AppOpenPlacementListener
        • RewardedVideoPlacement
        • RewardedVideoPlacementListener
        • NativeAdPlacement
        • NativePlacementListener
        • NativeAdData
        • AutoLoadBannerPlacement
        • AutoLoadBannerPlacementListener
        • AutoLoadMultiSizeBannerPlacement
        • AutoLoadMultiSizeBannerPlacementListener
        • ReportsDelegate
        • ImpressionListener
        • StatisticsListener
      • Enumerations
        • AATKitGender
        • AdNetwork
        • ManagedConsentState
        • NonIABConsent
        • BannerPlacementSize
        • BannerSize
        • MediationType
        • ImpressionPricePrecisionType
  • Samples
Powered by GitBook
On this page
  • Create Placement
  • Listen to Callbacks (Optional)
  • Request Ad
  • Ad Info
  • Display Ad
  • Has Ad
  • Complete Code Example
  1. Formats

Rewarded Video

Integrate Rewarded Video Ads

Last updated 7 months ago

In general, rewarded videos are similar to fullscreen ads in the aspect that it covers the whole screen of the device. What rewarded video ads add is the ability to reward the user when he watches the videos.

Create Placement

To create an instance of , use the following API:

RewardedVideoPlacement placement = AATKit.createRewardedVideoPlacement("<PLACEMENT_NAME>");
val placement = AATKit.createRewardedVideoPlacement("<PLACEMENT_NAME>")

Listen to Callbacks (Optional)

Through the use of , you can listen to the different placement callbacks.

placement.setListener(this);
placement.listener = this

AATKitReward

When the user is rewarded while watching a rewarded video, the placement will notify you through its delegate method: onUserEarnedIncentive passing itself and an instance.

Request Ad

You can load ads for the rewarded video placement either automatically or manually.

Automatic Reload

To automatically load rewarded video Placement:

placement.startAutoReload();
placement.startAutoReload()

This way the rewarded video placement will always try to have an ad ready. Please also remember to stop the auto-reload when it is no longer needed:

placement.stopAutoReload();
placement.stopAutoReload()

Manual Load

To manually load the rewarded video placement:

placement.reload();
placement.reload()

Ad Info

After loading a rewarded video, you can access the loaded ad information by accessing the adInfo property of the fullscreen placement:

AdInfo adInfo = placement.getAdInfo();
val info = placement.adInfo

Display Ad

the AATKit can be told to display a rewarded video placement using the following method:

placement.show();
placement.show()

The show() method will return a bool value indicating whether the rewarded video placement could be displayed or not. This means whether the rewarded video placement has a ready-rewarded video ad or not.

Has Ad

The rewarded video placement provides an API to check if it has a loaded ad.

boolean hasAd = placement.hasAd();
val hasAd = placement.hasAd()

Complete Code Example

 private RewardedVideoPlacement placement = AATKit.createRewardedVideoPlacement("<PLACEMENT_NAME>");

@Override
protected void onResume() {
    super.onResume();
    // [IMPORTANT] Notify AATKit about activity lifecycle
    AATKit.onActivityResume(this);

    // Set placement listener to listen to the callbacks
    placement.setListener(this);
    // Start autoreloading the placement.
    placement.startAutoReload();
}

@Override
protected void onPause() {
    // [IMPORTANT] Stop placement autoreload
    placement.stopAutoReload();
    // [IMPORTANT] Notify AATKit about activity lifecycle
    AATKit.onActivityPause(this);
    super.onPause();
}

private void watchVideo() {
    // An example for showing the rewarded video ad when the user clicks on "watch Video" button.
    if (!placement.show()) {
        // Show a message to the user telling: "Currently, no video available. Please try again later."
    }
}

// RewardedVideoPlacementListener
@Override
public void onPauseForAd(@NonNull Placement placement) {
    // Ad has been displayed on the screen
}

@Override
public void onResumeAfterAd(@NonNull Placement placement) {
    // Back to the app
}

@Override
public void onHaveAd(@NonNull Placement placement) {
    // The placement has loaded a new ad
}

@Override
public void onNoAd(@NonNull Placement placement) {
    // The placement could not load a new ad
}

@Override
public void onUserEarnedIncentive(@NonNull Placement placement, @Nullable AATKitReward aatKitReward) {
    // The user has earned an incentive for this placement.
}
private val placement = createRewardedVideoPlacement("<PLACEMENT_NAME>")

override fun onResume() {
    super.onResume()
    // [IMPORTANT] Notify AATKit about activity lifecycle
    AATKit.onActivityResume(this)

    // Set placement listener to listen to the callbacks
    placement?.listener = this
    // Start autoreloading the placement.
    placement?.startAutoReload()
}

override fun onPause() {
    // [IMPORTANT] Stop placement autoreload
    placement?.stopAutoReload()
    // [IMPORTANT] Notify AATKit about activity lifecycle
    AATKit.onActivityPause(this)
    super.onPause()
}

private fun watchVideo() {
    // An example for showing the rewarded video ad when the user clicks on "watch Video" button.
    if (placement?.show() == false) {
        // Show a message to the user telling: "Currently, no video available. Please try again later."
    }
}

// RewardedVideoPlacementListener
override fun onPauseForAd(placement: Placement) {
    // Ad has been displayed on the screen
}

override fun onResumeAfterAd(placement: Placement) {
    // Back to the app
}

override fun onHaveAd(placement: Placement) {
    // The placement has loaded a new ad
}

override fun onNoAd(placement: Placement) {
    // The placement could not load a new ad
}

override fun onUserEarnedIncentive(placement: Placement, aatKitReward: AATKitReward?) {
    // The user has earned an incentive for this placement.
}

The rewarded video placement fires the onHaveAd listener method only once per loaded ad. So, Before starting the auto-reload, you should check for ads from the previous load/auto-reload using the placement API.

RewardedVideoPlacement
RewardedVideoPlacementListener
AATKitReward
has ad