Class RewardedInterstitialAd
java.lang.Object
com.codename1.ads.RewardedInterstitialAd
A rewarded interstitial: a full screen ad shown at a transition that can
grant a reward but, unlike RewardedAd, is not strictly opt-in. The ad
network requires an intro screen with an opt-out, which the underlying SDK
presents automatically.
The API mirrors RewardedAd: register an OnUserEarnedRewardListener and
optionally setServerSideVerificationOptions(ServerSideVerificationOptions).
-
Constructor Summary
ConstructorsConstructorDescriptionRewardedInterstitialAd(String adUnitId) Creates a rewarded interstitial for the given ad unit id. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Releases the resources held by this ad.The listener notified of this ad's lifecycle events, may be null.booleanisLoaded()True when an ad is loaded and ready toshow().voidload()Loads an ad with default targeting.voidLoads an ad using the supplied targeting metadata.voidsetAdListener(AdListener listener) Sets the listener notified of this ad's lifecycle events.voidSets the reward listener used byshow().voidConfigures server side verification (SSV) of the reward.voidshow()Presents the loaded ad.voidshow(OnUserEarnedRewardListener listener) Presents the ad and registers the reward listener in one call.
-
Constructor Details
-
RewardedInterstitialAd
Creates a rewarded interstitial for the given ad unit id.
Parameters
adUnitId: the ad unit identifier from the network console
-
-
Method Details
-
setOnUserEarnedRewardListener
Sets the reward listener used byshow(). -
setServerSideVerificationOptions
Configures server side verification (SSV) of the reward. Must be set beforeshow(). -
show
Presents the ad and registers the reward listener in one call.
Parameters
listener: notified when the reward is earned
-
setAdListener
Sets the listener notified of this ad's lifecycle events. -
getAdListener
The listener notified of this ad's lifecycle events, may be null. -
load
public void load()Loads an ad with default targeting. -
load
Loads an ad using the supplied targeting metadata.
Parameters
request: optional targeting metadata, may be null
-
isLoaded
public boolean isLoaded()True when an ad is loaded and ready toshow(). -
show
public void show()Presents the loaded ad. Does nothing if no ad is loaded. -
dispose
public void dispose()Releases the resources held by this ad.
-