MoPubRewardedVideos

public class MoPubRewardedVideos

MoPubRewardedVideos is a utility class that holds controller methods for other MoPub rewarded video classes.

Public Methods

public static Set<MoPubReward> /getAvailableRewards(String adUnitId)

  • Description: Returns the Set of available rewards of type MoPubReward for this ad unit ID, if available; empty otherwise.

  • Parameters:

    • adUnitId: MoPub ad unit ID String.

public static boolean /hasRewardedVideo(String adUnitId)

  • Description: Returns true if the current rewarded video has successfully cached; false otherwise..

  • Parameters:

    • adUnitId: MoPub ad unit ID String.

public static void /loadRewardedVideo(String adUnitId, MediationSettings... mediationSettings)

  • Description: Attempts to make an ad request for the current ad unit ID with mediation settings.

  • Parameters:

public static void /loadRewardedVideo(String adUnitId, RequestParameters requestParameters, MediationSettings... mediationSettings)

  • Description: Attempts to make an ad request for the current ad unit ID with request parameters and mediation settings.

  • Parameters:

    • adUnitId: MoPub ad unit ID String.
    • requestParameters: An object for specifying targeting data such as keywords, location, and customer ID. Refer to RequestParameters.java.
    • mediationSettings: An implementation of the MediationSettings interface via which custom data to be used by a rewarded video ad network can be passed. They can be specified during initialization of the SDK. Example: An SdkConfiguration.Builder call withMediationSettings() can be created and passed in an array.

public static void /selectReward(String adUnitId, MoPubReward selectedReward)

  • Description: Selects a reward for the current ad unit ID, if available. Called to prompt the user to select from a number of rewards, if available.

  • Parameters:

    • adUnitId: MoPub ad unit ID String.
    • selectedReward: A reward of type MoPubReward.

public static void /setRewardedVideoListener(MoPubRewardedVideoListener listener)

  • Description: Registers a listener for the current ad object to be informed of the ad’s lifecycle events.

  • Parameters:

    • listener: An object containing listeners corresponding to the rewarded video’s lifecycle events.

public static void /showRewardedVideo(String adUnitId)

  • Description: Attempts to play the rewarded video if one has been cached for this ad unit ID.

  • Parameters:

    • adUnitId: MoPub ad unit ID String.

public static void /showRewardedVideo(String adUnitId, String customData)

  • Description: Attempts to play the rewarded video if one has been cached for this ad unit ID with custom data.

  • Parameters:

    • adUnitId: MoPub ad unit ID String.
    • customData: A String containing any data publishers wish to pass to their server.

Last updated March 04, 2020

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.

© 2020 MoPub (a division of Twitter, Inc.)