Class RewardedAd
Rewarded ads reward users with in-app items for interacting with video ads, playable ads, or surveys.
Implements
Inherited Members
Namespace: AppstockSDK.Api
Assembly: Appstock.Api.dll
Syntax
public class RewardedAd : IRewardedAd, IDisposable, IAdUnit, IMultiformattedAd, IResizableAd, IMuteableAd, ICloseableAd, IModalAd, ILoadableAd, IAdEventSource, IModalAdEventSource, IRewardingAdEventSource
Constructors
RewardedAd()
Initializes a new instance of the RewardedAd class.
Declaration
public RewardedAd()
Properties
AdSizes
Sets ad sizes for the ad.
Declaration
public IEnumerable<AdSize> AdSizes { set; }
Property Value
Type | Description |
---|---|
IEnumerable<AdSize> | Sizes that ad's content may take. |
AdUnitFormats
Sets formats for the ad unit.
Declaration
public IEnumerable<AdFormat> AdUnitFormats { set; }
Property Value
Type | Description |
---|---|
IEnumerable<AdFormat> | Ad formats that are allowed into the ad. |
CloseButtonArea
Sets close button area factor.
Declaration
public double CloseButtonArea { set; }
Property Value
Type | Description |
---|---|
double | the percentage of the device screen that the close button should cover. |
Remarks
Allowed range - 0...1
.
Default value is ~0.1
.
CloseButtonPosition
Sets position of the close button.
Declaration
public AdElementPosition CloseButtonPosition { set; }
Property Value
Type | Description |
---|---|
AdElementPosition | Where the close button appears on the screen. |
Remarks
EndpointID
Sets the endpoint ID for the ad.
Declaration
public string? EndpointID { set; }
Property Value
Type | Description |
---|---|
string | Unique endpoint identifier generated on the Appstock platform’s UI. |
Loaded
Gets if ad has loaded.
Declaration
public bool Loaded { get; }
Property Value
Type | Description |
---|---|
bool |
|
Muted
Sets if ad is to be muted.
Declaration
public bool Muted { set; }
Property Value
Type | Description |
---|---|
bool |
|
PlacementID
Sets the placement ID for the ad.
Declaration
public string? PlacementID { set; }
Property Value
Type | Description |
---|---|
string | Unique placement identifier generated on the Appstock platform’s UI. |
SoundButtonVisible
Sets if Mute
button is visible when the ad is on display.
Declaration
public bool SoundButtonVisible { set; }
Property Value
Type | Description |
---|---|
bool |
|
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Dispose(bool)
Releases the unmanaged resources used by the class and optionally releases the managed resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing |
|
~RewardedAd()
Declaration
protected ~RewardedAd()
LoadAd()
Load the content of the ad.
Declaration
public void LoadAd()
Show(Action?)
Show the ad on screen.
Declaration
public void Show(Action? actionOnUIThread = null)
Parameters
Type | Name | Description |
---|---|---|
Action | actionOnUIThread | Something you want to execute immediately when the ad is being added to the screen
|
Events
OnAdClicked
Fired when ad was clicked on.
Declaration
public event Action? OnAdClicked
Event Type
Type | Description |
---|---|
Action |
OnAdClosed
Fired when ad was closed (from fullscreen mode).
Declaration
public event Action? OnAdClosed
Event Type
Type | Description |
---|---|
Action |
OnAdDisplayed
Fired when ad did appear on screen.
Declaration
public event Action? OnAdDisplayed
Event Type
Type | Description |
---|---|
Action |
OnAdFailed
Fired when ad failed to load.
Declaration
public event Action<AdError?>? OnAdFailed
Event Type
Type | Description |
---|---|
Action<AdError?> |
OnAdLoaded
Fired when ad finished loading.
Declaration
public event Action? OnAdLoaded
Event Type
Type | Description |
---|---|
Action |
OnReward
Fired when user deserved the reward.
Declaration
public event Action<AdReward?>? OnReward
Event Type
Type | Description |
---|---|
Action<AdReward?> |