public class

MaxRewardedAd

extends Object
java.lang.Object
   ↳ com.applovin.mediation.ads.MaxRewardedAd

Class Overview

This class represents a full screen rewarded ad.

Summary

Public Methods
void destroy()
Destroy current ad and fully remove it from memory.
static MaxRewardedAd getInstance(String adUnitId, Activity activity)
Get an instance of rewarded ad.
static MaxRewardedAd getInstance(String adUnitId, AppLovinSdk sdk, Activity activity)
Get an instance of rewarded ad.
boolean isReady()
Check if this ad is ready to be shown.
void loadAd()
Load ad for the current rewarded ad.
void setExtrasParameter(String key, String value)
Set an extra parameter to pass to AppLovin server.
void setListener(MaxRewardedAdListener listener)
Set a listener that will be notified about ad display events (i.e.
void showAd()
Show the loaded rewarded ad.
void showAd(String placement)
Show the loaded rewarded ad for a given placement to tie ad events to.
String toString()
static void updateActivity(Activity activity)
Update currently active activity.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public void destroy ()

Destroy current ad and fully remove it from memory.

public static MaxRewardedAd getInstance (String adUnitId, Activity activity)

Get an instance of rewarded ad.

Parameters
adUnitId Ad unit id for which to get the instance. Must not be null.
activity Currently active activity. Must not be null.
Returns
  • An instance of rewarded ad tied to the specified ad unit ID.

public static MaxRewardedAd getInstance (String adUnitId, AppLovinSdk sdk, Activity activity)

Get an instance of rewarded ad.

Parameters
adUnitId Ad unit id for which to get the instance. Must not be null.
sdk Max ads SDK. Must not be null.
activity Currently active activity. Must not be null.
Returns
  • An instance of rewarded ad tied to the specified ad unit ID.

public boolean isReady ()

Check if this ad is ready to be shown.

Returns
  • true if the ad is ready to be shown.

public void loadAd ()

Load ad for the current rewarded ad. Use setListener(MaxRewardedAdListener) to assign a listener that should be notified about ad load state.

public void setExtrasParameter (String key, String value)

Set an extra parameter to pass to AppLovin server.

Parameters
key Parameter key. Must not be null.
value Parameter value. May be null.

public void setListener (MaxRewardedAdListener listener)

Set a listener that will be notified about ad display events (i.e. ad shown, hidden, etc.)

Parameters
listener Listener to be notified. May be null.

public void showAd ()

Show the loaded rewarded ad.

Use setListener(MaxRewardedAdListener) to assign a listener that should be notified about display events. Use isReady() to check if an ad was successfully loaded.

public void showAd (String placement)

Show the loaded rewarded ad for a given placement to tie ad events to.

Use setListener(MaxRewardedAdListener) to assign a listener that should be notified about display events. Use isReady() to check if an ad was successfully loaded.

Parameters
placement The placement to tie the showing ad's events to.

public String toString ()

public static void updateActivity (Activity activity)

Update currently active activity. This activity will be used to load new rewarded ads.

Note that Max Rewarded holds a weak reference to the activity.

Parameters
activity New activity to use. Must not be null.