RewardedAd Class
This is an archived version of the documentation. Actual documentation for all platforms can be found here.
A class for displaying rewarded ads.
Methods
RewardedAd(string blockId) | Creates an object of the RewardedAd class with the specified parameters. |
void LoadAd(AdRequest request) | Starts ad loading in the background. |
void IsLoaded() | Returns the result of ad loading. |
void Show() | Displays the ad if it was loaded. |
void Destroy() | Destroys an object of the RewardedAd class and clears all its occupied resources. |
RewardedAd(string blockId) | Creates an object of the RewardedAd class with the specified parameters. |
void LoadAd(AdRequest request) | Starts ad loading in the background. |
void IsLoaded() | Returns the result of ad loading. |
void Show() | Displays the ad if it was loaded. |
void Destroy() | Destroys an object of the RewardedAd class and clears all its occupied resources. |
Events
event EventHandler<EventArgs> OnRewardedAdLoaded | Called when the ad is loaded. . |
event EventHandler<AdFailureEventArgs> OnRewardedAdFailedToLoad | Called if ad loading fails. |
event EventHandler<EventArgs> OnReturnedToApplication | Called when the user returns to the app after the click. |
event EventHandler<EventArgs> OnLeftApplication | Called when the app becomes inactive because the user has clicked on an ad and is about to switch to a different app (for example, a browser). |
event EventHandler<EventArgs> OnAdClicked | It's called when the user clicks on your ad. |
event EventHandler<EventArgs> OnRewardedAdShown | Called when the ad has been shown. |
event EventHandler<EventArgs> OnRewardedAdDismissed | Called when the ad has been closed. |
event EventHandler<ImpressionData> OnImpression | It's called when an ad impression has been counted. |
event EventHandler<AdFailureEventArgs> OnRewardedAdFailedToShow | Called when the ad can't be shown. |
event EventHandler<Reward> OnRewarded | Called when a user should be rewarded for viewing an ad (impression counted). |
event EventHandler<EventArgs> OnRewardedAdLoaded | Called when the ad is loaded. . |
event EventHandler<AdFailureEventArgs> OnRewardedAdFailedToLoad | Called if ad loading fails. |
event EventHandler<EventArgs> OnReturnedToApplication | Called when the user returns to the app after the click. |
event EventHandler<EventArgs> OnLeftApplication | Called when the app becomes inactive because the user has clicked on an ad and is about to switch to a different app (for example, a browser). |
event EventHandler<EventArgs> OnAdClicked | It's called when the user clicks on your ad. |
event EventHandler<EventArgs> OnRewardedAdShown | Called when the ad has been shown. |
event EventHandler<EventArgs> OnRewardedAdDismissed | Called when the ad has been closed. |
event EventHandler<ImpressionData> OnImpression | It's called when an ad impression has been counted. |
event EventHandler<AdFailureEventArgs> OnRewardedAdFailedToShow | Called when the ad can't be shown. |
event EventHandler<Reward> OnRewarded | Called when a user should be rewarded for viewing an ad (impression counted). |
Method description
RewardedAd(string blockId)
public RewardedAd(string blockId)
Creates an object of the RewardedAd class with the specified parameters.
blockId | A unique identifier of the advertising space that is set in the Partner interface in the format demo-banner-yandex. |
blockId | A unique identifier of the advertising space that is set in the Partner interface in the format demo-banner-yandex. |
Returns:
An object of the RewardedAd
class with the specified parameters.
void LoadAd(AdRequest request)
public void LoadAd(AdRequest request)
Starts ad loading in the background.
request | An object of the AdRequest class including the data for a targeted ad request. |
request | An object of the AdRequest class including the data for a targeted ad request. |
bool isLoaded()
public bool isLoaded()
Returns the result of ad loading.
Returns:
true
when the ad is loaded and ready to be displayed. false
if the ad is not loaded or not ready to be displayed.
void Show()
public void Show()
Displays the ad if it was loaded.
void Destroy()
public void Destroy()
Destroys an object of the RewardedAd class and clears all its occupied resources.
Event description
event EventHandler<EventArgs> OnRewardedAdLoaded
public event EventHandler<EventArgs> OnRewardedAdLoaded
Called when the ad is loaded.
event EventHandler<AdFailureEventArgs> OnRewardedAdFailedToLoad
public event EventHandler<AdFailureEventArgs> OnRewardedAdFailedToLoad
Called if ad loading fails.
event EventHandler<EventArgs> OnReturnedToApplication
public event EventHandler<EventArgs> OnReturnedToApplication
Called when the user returns to the app after the click.
event EventHandler<EventArgs> OnLeftApplication
public event EventHandler<EventArgs> OnLeftApplication
Called when the app becomes inactive because the user has clicked on an ad and is about to switch to a different app (for example, a browser).
event EventHandler<EventArgs> OnAdClicked
public event event EventHandler<EventArgs> OnAdClicked
It's called when the user clicks on your ad.
event EventHandler<EventArgs> OnRewardedAdShown
public event event EventHandler<EventArgs> OnRewardedAdShown
Called when the ad has been shown.
event EventHandler<EventArgs> OnRewardedAdDismissed
public event event EventHandler<EventArgs> OnRewardedAdDismissed
Called when the ad has been closed.
event EventHandler<ImpressionData> OnImpression
public event event EventHandler<ImpressionData> OnImpression
It's called when an ad impression has been counted.
event EventHandler<AdFailureEventArgs> OnRewardedAdFailedToShow
public event event EventHandler<IAdFailureEventArgs> OnRewardedAdFailedToShow
Called when the ad can't be shown.
event EventHandler<Reward> OnRewarded
public event event EventHandler<Reward> OnRewarded
Called when a user should be rewarded for viewing an ad (impression counted).