public class

AppLovinIncentivizedInterstitial

extends Object
java.lang.Object
   ↳ com.applovin.adview.AppLovinIncentivizedInterstitial

Class Overview

This class implements rewarded videos..

Summary

Public Constructors
AppLovinIncentivizedInterstitial(Context context)
Create a new instance of AppLovinIncentivizedInterstitial.
AppLovinIncentivizedInterstitial(AppLovinSdk sdk)
Create a new instance of AppLovinIncentivizedInterstitial.
Public Methods
static AppLovinIncentivizedInterstitial create(AppLovinSdk sdk)
Create a new instance of AppLovinIncentivizedInterstitial.
static AppLovinIncentivizedInterstitial create(Context context)
Create a new instance of AppLovinIncentivizedInterstitial.
void dismiss()
Dismiss an incentivized interstitial prematurely, before video playback has completed.
String getUserIdentifier()
Get the last set user identifier.
boolean isAdReadyToDisplay()
Check if an ad is currently ready on this object.
void preload(AppLovinAdLoadListener adLoadListener)
Pre-load an incentivized interstitial.
void setUserIdentifier(String userIdentifier)
Set a user identifier that will be passed through to your server via S2S postbacks.
void show(Activity activity, String placement, AppLovinAdRewardListener adRewardListener, AppLovinAdVideoPlaybackListener videoPlaybackListener, AppLovinAdDisplayListener adDisplayListener, AppLovinAdClickListener adClickListener)
Show a pre-loaded incentivized interstitial.
void show(Activity activity)
Show a pre-loaded incentivized interstitial.
void show(Activity activity, AppLovinAdRewardListener adRewardListener, AppLovinAdVideoPlaybackListener videoPlaybackListener, AppLovinAdDisplayListener adDisplayListener)
Show a pre-loaded incentivized interstitial.
void show(Activity activity, AppLovinAdRewardListener adRewardListener)
Show a pre-loaded incentivized interstitial.
void show(Activity activity, AppLovinAdRewardListener adRewardListener, AppLovinAdVideoPlaybackListener videoPlaybackListener)
Show a pre-loaded incentivized interstitial.
void show(Activity activity, AppLovinAdRewardListener adRewardListener, AppLovinAdVideoPlaybackListener videoPlaybackListener, AppLovinAdDisplayListener adDisplayListener, AppLovinAdClickListener adClickListener)
Show a pre-loaded incentivized interstitial.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public AppLovinIncentivizedInterstitial (Context context)

Create a new instance of AppLovinIncentivizedInterstitial.

Parameters
context Context to use.

public AppLovinIncentivizedInterstitial (AppLovinSdk sdk)

Create a new instance of AppLovinIncentivizedInterstitial.

Parameters
sdk An instance of AppLovinSdk to use.

Public Methods

public static AppLovinIncentivizedInterstitial create (AppLovinSdk sdk)

Create a new instance of AppLovinIncentivizedInterstitial.

Parameters
sdk An instance of AppLovinSdk to use.

public static AppLovinIncentivizedInterstitial create (Context context)

Create a new instance of AppLovinIncentivizedInterstitial.

Parameters
context Context to use.

public void dismiss ()

Dismiss an incentivized interstitial prematurely, before video playback has completed. In most circumstances, this is not recommended, as it may confuse users by denying them a reward.

public String getUserIdentifier ()

Get the last set user identifier.

Returns
  • Any user identifier you have previously provided us. Otherwise, null.

public boolean isAdReadyToDisplay ()

Check if an ad is currently ready on this object. You must call preloadAndNotify in order to reach this state. It is highly recommended that you implement an asynchronous flow (using an AppLovinAdDisplayListener with preload) rather than checking this method. This class does not contain a queue and can hold only one preloaded ad at a time. Further calls to preload will overwrite any existing ad. Therefore, you should NOT simply call preload any time this method returns false; it is important to invoke only one ad load - then not invoke any further loads until the ad has been closed (e.g., AppLovinAdDisplayListener's adHidden callback).

Returns
  • True if an ad has been loaded into this incentivized interstitial and is ready to display. False otherwise.

public void preload (AppLovinAdLoadListener adLoadListener)

Pre-load an incentivized interstitial. Calling this method will overwrite any existing cached ad. This is not a queue. Invoke once to preload, then do not invoke again until the ad has has been closed (e.g., AppLovinAdDisplayListener's adHidden callback). You may pass a null argument to preload if you intend to use the synchronous ( isAdReadyToDisplay ) flow. Note that this is NOT recommended; we HIGHLY RECOMMEND you use an ad load delegate. Note that we internally try to pull down the next ad's resources before you need it. Therefore, this method may complete immediately in many circumstances.

Parameters
adLoadListener Ad load listener to notify. May be null..

public void setUserIdentifier (String userIdentifier)

Set a user identifier that will be passed through to your server via S2S postbacks. If you are using reward validation, you can pass us a user identifier as a String. This could be something like a username, for example. We will pass it to your server when we make our S2S call during reward validation.

Parameters
userIdentifier Some string which will be passed to your server later, for purposes of identifying the user who should receive a reward.

public void show (Activity activity, String placement, AppLovinAdRewardListener adRewardListener, AppLovinAdVideoPlaybackListener videoPlaybackListener, AppLovinAdDisplayListener adDisplayListener, AppLovinAdClickListener adClickListener)

Show a pre-loaded incentivized interstitial. You must call preload before calling show.

Parameters
placement Placement name to use.
adRewardListener Reward listener to notify, if desired. May be null.
videoPlaybackListener Video playback listener to notify. May be null.
adDisplayListener Ad display listener to notify, if desired. May be null.
adClickListener Ad click listener to notify, if desired. May be null.

public void show (Activity activity)

Show a pre-loaded incentivized interstitial. You must call preload before calling show.

public void show (Activity activity, AppLovinAdRewardListener adRewardListener, AppLovinAdVideoPlaybackListener videoPlaybackListener, AppLovinAdDisplayListener adDisplayListener)

Show a pre-loaded incentivized interstitial. You must call preload before calling show.

Parameters
adRewardListener Reward listener to notify, if desired. May be null.
videoPlaybackListener Video playback listener to notify. Must not be null.
adDisplayListener Ad display listener to notify, if desired. May be null.

public void show (Activity activity, AppLovinAdRewardListener adRewardListener)

Show a pre-loaded incentivized interstitial. You must call preload before calling show.

Parameters
adRewardListener Reward listener to notify, if desired. May be null. Using the reward listener, you will be able to verify with AppLovin servers the the video view is legitimate, as we will confirm whether the specific ad was actually served - then we will ping your server with a url for you to update the user's balance. The Reward Validation Listener will tell you whether we were able to reach our servers or not. If you receive a successful response, you should refresh the user's balance from your server. For more info, see the documentation.

public void show (Activity activity, AppLovinAdRewardListener adRewardListener, AppLovinAdVideoPlaybackListener videoPlaybackListener)

Show a pre-loaded incentivized interstitial. You must call preload before calling show.

Parameters
adRewardListener Reward listener to notify, if desired. May be null.
videoPlaybackListener Video playback listener to notify. Must not be null.

public void show (Activity activity, AppLovinAdRewardListener adRewardListener, AppLovinAdVideoPlaybackListener videoPlaybackListener, AppLovinAdDisplayListener adDisplayListener, AppLovinAdClickListener adClickListener)

Show a pre-loaded incentivized interstitial. You must call preload before calling show.

Parameters
adRewardListener Reward listener to notify, if desired. May be null.
videoPlaybackListener Video playback listener to notify. May be null.
adDisplayListener Ad display listener to notify, if desired. May be null.
adClickListener Ad click listener to notify, if desired. May be null.