Rewarded Ad Methods /
API for Rewarded Videos.
Public Properties
public const double /LatLongSentinel /+5.0.0
- Description: Constant used as the default value of
99999.0
for latitude and longitude in rewarded videos.
Public Methods
public static void /RequestRewardedVideo(string adUnitId, List<LocalMediationSetting> mediationSettings, string keywords, string userDataKeywords, double latitude, double longitude, string customerId) /+5.0.0
-
Description: Requests a rewarded video ad with the given (optional) configuration to be loaded. The two possible resulting events are
MoPubManager.OnRewardedVideoLoadedEvent
andMoPubManager.OnRewardedVideoFailedEvent
. -
Parameters:
adUnitId
: A String with the ad unit ID.mediationSettings
: Refer toMoPub.SdkConfiguration.MediationSettings
. Default value is null.keywords
: An optional comma-separated String with the desired keywords for this ad. Default value is null.userDataKeywords
: An optional comma-separated String with user data for this ad. Default value is null.latitude
: An optional location latitude to be used for this ad.longitude
: An optional location longitude to be used for this ad.customerId
: An optional String to identify this user within this app. Default value is null.
public static void /ShowRewardedVideo(string adUnitId, string customData) /+5.0.0
-
Description: If the rewarded video ad has loaded, this will take over the screen and show the ad.
MoPubManager.OnRewardedVideoLoadedEvent
must have been triggered already. -
Parameters:
adUnitId
: A String with the ad unit ID.customData
: An optional String with custom data for the ad. Default value is null.
public static bool /HasRewardedVideo(string adUnitId) /+5.0.0
-
Description: Whether a rewarded video is ready to play for this ad unit. Returns
true
if a rewarded ad for the given ad unit id is loaded and ready to be shown;false
otherwise. -
Parameters:
adUnitId
: A String with the ad unit ID.
public static List<Reward> /GetAvailableRewards(string adUnitId) /+5.0.0
-
Description: Retrieves a list of available rewards for the given ad unit ID. Returns a list of
MoPub.Rewards
for the given ad unit ID. -
Parameters:
adUnitId
: A String with the ad unit ID.
public static void /SelectReward(string adUnitId, Reward selectedReward) /+5.0.0
-
Description: Selects the reward to give the user when the ad has finished playing.
-
Parameters:
adUnitId
: A String with the ad unit ID.selectedReward
: SeeMoPub.Reward
.
Last updated March 30, 2021
TWITTER, MOPUB, and the Bird logo are trademarks of Twitter, Inc. or its affiliates. All third party logos and trademarks included are the property of their respective owners.
© 2021 MoPub (a division of Twitter, Inc.)