Class LevelPlayInterstitialAd
-
- All Implemented Interfaces:
public final class LevelPlayInterstitialAdClass responsible for handling the APIs, callbacks and overall operations of an interstitial ad.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classLevelPlayInterstitialAd.ConfigInterstitial ad configurations
Use the builder to construct a configuration
-
Constructor Summary
Constructors Constructor Description LevelPlayInterstitialAd(String adUnitId)Initializes an interstitial ad. LevelPlayInterstitialAd(String adUnitId, LevelPlayInterstitialAd.Config config)Initializes an interstitial ad with configuration.
-
Method Summary
Modifier and Type Method Description final StringgetAdUnitId()The ad unit identifier. final StringgetAdId()final UnitloadAd()Loads an interstitial ad. final UnitshowAd(Activity activity, String placementName)Shows the ad. final UnitshowAd(Activity activity)Shows the ad. final BooleanisAdReady()Checks if the ad is ready. final UnitsetListener(LevelPlayInterstitialAdListener listener)Sets a listener for the ad callbacks. final static BooleanisPlacementCapped(String placementName)Checks if the placement is capped. -
-
Constructor Detail
-
LevelPlayInterstitialAd
LevelPlayInterstitialAd(String adUnitId)
Initializes an interstitial ad.- Parameters:
adUnitId- The ad unit identifier.
-
LevelPlayInterstitialAd
LevelPlayInterstitialAd(String adUnitId, LevelPlayInterstitialAd.Config config)
Initializes an interstitial ad with configuration.- Parameters:
adUnitId- The ad unit identifier.config- The adunit configuration
-
-
Method Detail
-
getAdUnitId
final String getAdUnitId()
The ad unit identifier.
-
loadAd
final Unit loadAd()
Loads an interstitial ad. The listener will send a onAdLoaded() or onAdLoadFailed() callback. The callbacks will be invoked on the main thread.
-
showAd
@JvmOverloads() final Unit showAd(Activity activity, String placementName)
Shows the ad. The listener will send a onAdDisplayed() or onAdDisplayFailed() callback. The callbacks will be invoked on the main thread.
- Parameters:
activity- The activity where the ad will be shown.placementName- The placement name for the ad.
-
showAd
@JvmOverloads() final Unit showAd(Activity activity)
Shows the ad. The listener will send a onAdDisplayed() or onAdDisplayFailed() callback. The callbacks will be invoked on the main thread.
- Parameters:
activity- The activity where the ad will be shown.
-
isAdReady
final Boolean isAdReady()
Checks if the ad is ready. Showing an ad that is not ready will result in a show failure. When calling to the show api with placement, make sure to verify that placement isn't capped via isPlacementCapped().
- Returns:
True if the ad is ready, false otherwise.
-
setListener
final Unit setListener(LevelPlayInterstitialAdListener listener)
Sets a listener for the ad callbacks. The callbacks will be invoked on the main thread.
- Parameters:
listener- The listener to set.
-
isPlacementCapped
final static Boolean isPlacementCapped(String placementName)
Checks if the placement is capped.
- Parameters:
placementName- The placement name to check.- Returns:
True if the placement is capped, false otherwise.
-
-
-
-