MPRewardedVideo /3.5.0

@interface MPRewardedVideo : NSObject

MPRewardedVideo enables you to load and play rewarded video ads. All ad events are reported, with an ad unit ID, to the delegate allowing the application to respond to the events for the corresponding ad.

Public Methods

+/setDelegate:forAdUnitId: /+5.0.0

  • Description: Sets the delegate that will be the receiver of rewarded video events for the given ad unit ID. A weak reference to the delegate will be held.

  • Declaration:

    + (void)setDelegate:(id<MPRewardedVideoDelegate>)delegate
          forAdUnitId:(NSString *)adUnitId;
    
  • Parameters:

    • delegate: Delegate that will receive rewarded video events for the ad unit ID.
    • adUnitId: Ad unit ID.

+/removeDelegate: /+5.0.0

  • Description: Removes the delegate as a receiver of rewarded video events for all available ad unit IDs.

  • Declaration:

    + (void)removeDelegate:(id<MPRewardedVideoDelegate>)delegate;
    
  • Parameters:

    • delegate: Reference to the delegate to remove as a listener.

+/removeDelegateForAdUnitId: /+5.0.0

  • Description: Removes the rewarded video delegate that is associated with the ad unit ID.

  • Declaration:

    + (void)removeDelegateForAdUnitId:(NSString *)adUnitId;
    
  • Parameters:

    • adUnitId: Ad unit ID of the delegate to remove.

+/loadRewardedVideoAdWithAdUnitID:withMediationSettings: /+3.5.0

  • Description: Loads a rewarded video ad for the given ad unit ID. The mediation settings array should contain ad network-specific objects for networks that may be loaded for the given ad unit ID. You should set the properties on these objects to determine how the underlying ad network should behave. Only supply objects for the networks you wish to configure. To prevent your network from straying from its default behavior, do not pass in a mediation settings object for that network.

  • Declaration:

    + (void)loadRewardedVideoAdWithAdUnitID:(NSString *)adUnitID
                    withMediationSettings:(NSArray *)mediationSettings;
    
  • Parameters:

    • adUnitID: The ad unit ID from which ads should be loaded.
    • mediationSettings: An array of mediation settings objects that map to networks that may show ads for the ad unit ID. This array should only contain objects for networks you wish to configure. This can be nil.

+/loadRewardedVideoAdWithAdUnitID:keywords:userDataKeywords:location:mediationSettings: /+5.0.0-5.12.0

  • Description: Loads a rewarded video ad for the given ad unit ID. The mediation settings array should contain ad network-specific objects for networks that may be loaded for the given ad unit ID. Set the properties on these objects to determine how the underlying ad network should behave. Only supply objects for the networks you wish to configure. To prevent your network from straying from its default behavior, do not pass in an mediation settings object for that network.

    Note that if a user is in a General Data Protection Regulation (GDPR) region and MoPub doesn’t obtain consent from the user, keywords will be sent to the server but userDataKeywords will be excluded.

  • Declaration:

    + (void)loadRewardedVideoAdWithAdUnitID:(NSString *)adUnitID
                                 keywords:(NSString *)keywords
                         userDataKeywords:(NSString *)userDataKeywords
                                 location:(CLLocation *)location
                        mediationSettings:(NSArray *)mediationSettings;
    
  • Parameters:

    • adUnitID: The ad unit ID from which ads should be loaded.
    • keywords: A string representing a set of non-personally-identifiable keywords that should be passed to the MoPub ad server to receive more relevant advertising.
    • userDataKeywords: A string representing a set of personally identifiable keywords that should be passed to the MoPub ad server to receive more relevant advertising.
    • location: Latitude and Longitude that are passed to the MoPub ad server.
    • mediationSettings: An array of mediation settings objects that map to networks that may show ads for the ad unit ID. This array should only contain objects for networks you wish to configure. This can be nil.

+/loadRewardedVideoAdWithAdUnitID:keywords:userDataKeywords:customerId:mediationSettings: /+5.0.0

  • Description: Loads a rewarded video ad for the given ad unit ID. The mediation settings array should contain ad network-specific objects for networks that may be loaded for the given ad unit ID. Set the properties on these objects to determine how the underlying ad network should behave. Only supply objects for the networks you wish to configure. To prevent your network from straying from its default behavior, do not pass in an mediation settings object for that network.

    Note that if a user is in a General Data Protection Regulation (GDPR) region and MoPub doesn’t obtain consent from the user, keywords will be sent to the server but userDataKeywords will be excluded.

  • Declaration:

    + (void)loadRewardedVideoAdWithAdUnitID:(NSString *)adUnitID
                                   keywords:(NSString *)keywords
                           userDataKeywords:(NSString *)userDataKeywords
                                 customerId:(NSString *)customerId
                          mediationSettings:(NSArray *)mediationSettings;
    
  • Parameters:

    • adUnitID: The ad unit ID from which ads should be loaded.
    • keywords: A string representing a set of non-personally-identifiable keywords that should be passed to the MoPub ad server to receive more relevant advertising.
    • userDataKeywords: A string representing a set of personally identifiable keywords that should be passed to the MoPub ad server to receive more relevant advertising.
    • customerID: This is the ID given to the user by the publisher to identify them in their app.
    • mediationSettings: An array of mediation settings objects that map to networks that may show ads for the ad unit ID. This array should only contain objects for networks you wish to configure. This can be nil.

+/loadRewardedVideoAdWithAdUnitID:keywords:userDataKeywords:customerId:mediationSettings:localExtras: /+5.4.0

  • Description: Loads a rewarded video ad for the given ad unit ID. The mediation settings array should contain ad network-specific objects for networks that may be loaded for the given ad unit ID. Set the properties on these objects to determine how the underlying ad network should behave. Only supply objects for the networks you wish to configure. To prevent your network from straying from its default behavior, do not pass in an mediation settings object for that network.

    Note that if a user is in a General Data Protection Regulation (GDPR) region and MoPub doesn’t obtain consent from the user, keywords will be sent to the server but userDataKeywords will be excluded.

  • Declaration:

    + (void)loadRewardedVideoAdWithAdUnitID:(NSString *)adUnitID
                                   keywords:(NSString *)keywords
                           userDataKeywords:(NSString *)userDataKeywords
                                 customerId:(NSString *)customerId
                          mediationSettings:(NSArray *)mediationSettings
                                localExtras:(NSDictionary *)localExtras;
    
  • Parameters:

    • adUnitID: The ad unit ID from which ads should be loaded.
    • keywords: A string representing a set of non-personally-identifiable keywords that should be passed to the MoPub ad server to receive more relevant advertising.
    • userDataKeywords: A string representing a set of personally identifiable keywords that should be passed to the MoPub ad server to receive more relevant advertising.
    • customerID: This is the ID given to the user by the publisher to identify them in their app.
    • mediationSettings: An array of mediation settings objects that map to networks that may show ads for the ad unit ID. This array should only contain objects for networks you wish to configure. This can be nil.
    • localExtras: An optional dictionary containing extra local data.

+/hasAdAvailableForAdUnitID: /+3.5.0

  • Description: Returns whether or not an ad is available for the given ad unit ID.

  • Declaration:

    + (BOOL)hasAdAvailableForAdUnitID:(NSString *)adUnitID;
    
  • Parameters:

    • adUnitID: The ad unit ID associated with the ad whose availability you wish to retrieve.

+/availableRewardsForAdUnitID: /+5.0.0

  • Description: Returns an array of rewards that are available for the given ad unit ID.

  • Declaration:

    + (NSArray *)availableRewardsForAdUnitID:(NSString *)adUnitID;
    
  • Parameters: None.

+/selectedRewardForAdUnitID: /+5.0.0

  • Description: The currently selected reward that will be awarded to the user upon completion of the ad. By default, this corresponds to the first reward in availableRewardsForAdUnitID:.

  • Declaration:

    + (MPRewardedVideoReward *)selectedRewardForAdUnitID:(NSString *)adUnitID;
    
  • Parameters: None.

+/presentRewardedVideoAdForAdUnitID:fromViewController:withReward: /+3.5.0

  • Description: Plays a rewarded video ad. Important: Do not attempt to play the rewarded video unless hasAdAvailableForAdUnitID: indicates that an ad is available for playing, or you have received the rewardedVideoAdDidLoadForAdUnitID: message.

  • Declaration:

    + (void)presentRewardedVideoAdForAdUnitID:(NSString *)adUnitID
                         fromViewController:(UIViewController *)viewController
                                 withReward:(MPRewardedVideoReward *)reward;
    
  • Parameters:

    • adUnitID: The ad unit ID associated with the video ad you wish to play.
    • viewController: The view controller that will present the rewarded video ad.
    • reward: A reward selected from availableRewardsForAdUnitID: to award the user upon successful completion of the ad. This value should not be nil.

+/presentRewardedVideoAdForAdUnitID:fromViewController:withReward:customData: /+5.0.0

  • Description: Plays a rewarded video ad. Important: Do not attempt to play the rewarded video unless hasAdAvailableForAdUnitID: indicates that an ad is available for playing, or you have received the rewardedVideoAdDidLoadForAdUnitID: message.

  • Declaration:

    + (void)presentRewardedVideoAdForAdUnitID:(NSString *)adUnitID
                         fromViewController:(UIViewController *)viewController
                                 withReward:(MPRewardedVideoReward *)reward
                                 customData:(NSString *)customData;
    
  • Parameters:

    • adUnitID: The ad unit ID associated with the video ad you wish to play.
    • viewController: The view controller that will present the rewarded video ad.
    • reward: A reward selected from availableRewardsForAdUnitID: to award the user upon successful completion of the ad. This value should not be nil.
    • customData: Optional custom data string to include in the server-to-server callback. If a server-to-server callback is not used, or if the ad unit is configured for local rewarding, this value will not be persisted.

Last updated October 06, 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.)