Package com.yandex.mobile.ads.rewarded
Class RewardedAd
- java.lang.Object
-
- com.yandex.mobile.ads.fullscreen.FullScreenAd
-
- com.yandex.mobile.ads.rewarded.RewardedAd
-
- All Implemented Interfaces:
com.yandex.mobile.ads.fullscreen.FullScreenAdvertisable,com.yandex.mobile.ads.html.BaseAdvertisable
@MainThread public final class RewardedAd extends com.yandex.mobile.ads.fullscreen.FullScreenAdFull-screen rewarded ad.
-
-
Constructor Summary
Constructors Constructor Description RewardedAd(android.content.Context context)Constructs a newRewardedAdprogrammatically.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()Destroys thisRewardedAdentirely and cleans up resources.booleanisLoaded()Returnstrueif this rewarded ad has been successfully loaded and is ready to be shown, otherwisefalse.voidloadAd(AdRequest adRequest)Starts loading the ad byAdRequeston a background thread.voidsetAdUnitId(java.lang.String adUnitId)Sets a valid ad unit ID.voidsetRewardedAdEventListener(RewardedAdEventListener rewardedAdEventListener)Sets anRewardedAdEventListener.voidshow()Shows the rewarded ad, only if it has been loaded.
-
-
-
Constructor Detail
-
RewardedAd
@MainThread public RewardedAd(@NonNull android.content.Context context)Constructs a newRewardedAdprogrammatically.- Parameters:
context- The activity context the view is running in, through which it can access the current theme, resources, etc. In particular, it uses the window manager and theme in this context to present its UI.
-
-
Method Detail
-
loadAd
@MainThread public void loadAd(@NonNull AdRequest adRequest)Starts loading the ad byAdRequeston a background thread.NOTE:The ad unit id must be set before that.- Parameters:
adRequest-AdRequest
-
isLoaded
@MainThread public boolean isLoaded()
Returnstrueif this rewarded ad has been successfully loaded and is ready to be shown, otherwisefalse.- Returns:
trueif this rewarded ad has been successfully loaded and is ready to be shown.
-
setAdUnitId
@MainThread public void setAdUnitId(@NonNull java.lang.String adUnitId)Sets a valid ad unit ID. Ad unit ID can be set only once.- Parameters:
adUnitId- Unique ad placement ID created at partner interface.
-
setRewardedAdEventListener
@MainThread public void setRewardedAdEventListener(@Nullable RewardedAdEventListener rewardedAdEventListener)Sets anRewardedAdEventListener.- Parameters:
rewardedAdEventListener-RewardedAdEventListener.
-
show
@MainThread public void show()
Shows the rewarded ad, only if it has been loaded.
-
destroy
@MainThread public void destroy()
Destroys thisRewardedAdentirely and cleans up resources.NOTE:Don't work with thisRewardedAdthereafter.
-
-