Rewarded Video Ads


Rewarded video ads are a great way to offer users an incentive to stay engaged in your app, while earning more ad revenue. The reward generally comes in the form of in-game currency (gold, coins, power-ups) and is distributed to the user after a successful video completion.

MoPub’s mediation solution officially supports rewarded videos from popular ad networks like AdColony, Unity Ads, Vungle, Chartboost and Tapjoy. We give you the flexibility to work with these popular ad networks without any extra integration with network SDKs.

We recommend placing rewarded video ads where your users are already engaging with in-app purchases or in locations where users may be seeking an in-app reward, such as the end of a game or at currency redemption points. Once your users have finished watching the video ad, you can designate the reward they will receive.

Getting Started

  • Before integrating rewarded video ads in your app, you’ll need to go through the steps in our Getting Started, create an account on MoPub and integrate the SDK into your project.
  • Add a rewarded video ad unit to your app in the MoPub dashboard.
  • Make sure you have added the ad network SDKs you wish to use to your app.
  • Set up your networks as custom native networks in the MoPub dashboard by following the instructions here.

Basic Integration

1. Import the required classes

In your app delegate’s header file:

  1. Import the MoPub.h header file
  2. Import the MPRewardedVideo.h header file

2. Initialize

Declare that your app delegate implements the MPRewardedVideoDelegate protocol. And In your app delegate’s implementation file, initialize rewarded video through the MoPub object using the below method, passing in your app delegate as the delegate. More details about integration are available below

[MoPub sharedInstance] initializeRewardedVideoWithGlobalMediationSettings:nil delegate:self ]];

3. Pre-fetch the rewarded video ad

For the given ad unit, precache the rewarded video as shown below

[MPRewardedVideo loadRewardedVideoAdWithAdUnitID:@"[Placeholder Ad Unit ID]" withMediationSettings:nil];

4. Verify that the rewarded video is precached

In your view controller, call the +hasAdAvailableForAdUnitID: on the MPRewardedVideo class passing in your ad unit ID prior to displaying the ad.

5. Show the rewarded video

Finally, present the precached rewarded video.

[MPRewardedVideo presentRewardedVideoAdForAdUnitID:@"[Placeholder Ad Unit ID]" fromViewController:self];

6. Optional: Implement the delegate methods

MPRewardedVideoDelegate includes a variety of optional callbacks that you can use to be notified of events, e.g. when a rewarded video has successfully loaded, or when a rewarded video is about to appear. Check out the MPRewardedVideoDelegate for the following methods

- (void)rewardedVideoAdDidLoadForAdUnitID:(NSString *)adUnitID
- (void)rewardedVideoAdDidFailToPlayForAdUnitID:(NSString *)adUnitID error:(NSError *)error;
- (void)rewardedVideoAdWillAppearForAdUnitID:(NSString *)adUnitID
- (void)rewardedVideoAdDidAppearForAdUnitID:(NSString *)adUnitID
- (void)rewardedVideoAdWillDisappearForAdUnitID:(NSString *)adUnitID
- (void)rewardedVideoAdDidDisappearForAdUnitID:(NSString *)adUnitID
- (void)rewardedVideoAdDidExpireForAdUnitID:(NSString *)adUnitID
- (void)rewardedVideoAdDidReceiveTapEventForAdUnitID:(NSString *)adUnitID
- (void)rewardedVideoAdShouldRewardForAdUnitID:(NSString *)adUnitID reward:(MPRewardedVideoReward *)reward
- (void)rewardedVideoAdWillLeaveApplicationForAdUnitID:(NSString *)adUnitID;

Here are a few examples of how callacks can be useful:

  • You can be notified that a rewarded video was fetched successfully by implementing -rewardedVideoAdDidLoadForAdUnitID:
  • If you’d like to pause the game whenever you present a rewarded video, and resume it when the rewarded video is dismissed, you can accomplish it using the -rewardedVideoAdWillAppearForAdUnitID: and -rewardedVideoAdDidDisappearForAdUnitID: delegate callbacks.

Note: Include the custom event class and library/framework for the mediated network for network demand.

Advanced: Mediation Settings

Mediation settings enable you to pass in third-party network specific settings and can be provided as additional parameters during the rewarded video initialization call. For Vungle, Unity and Chartboost mediation, this is the only mechanism by which a user-Id or custom-Id can be specified in networks’ server-side callbacks.

Upon initializing rewarded video via a call to -initializeRewardedVideoWithGlobalMediationSettings:delegate:, you may pass in an array of configured global mediation objects. These objects are used to configure the underlying ad networks which in turn affects all ads for the specific network. Any given ad network may or may not have global mediation settings classes. Using a global mediation settings class involves:

  • Creating an instance of the global settings class for an ad networks that may supply ads to your application.
  • Configuring the properties on the objects.
  • Passing them inside an array when initializing rewarded video.

Furthermore, you may pass in instance mediation settings when calling +loadRewardedVideoAdWithAdUnitID:withMediationSettings:. These settings apply to the ad network for the ad unit ID you are using to load an ad. Any given ad network may or may not have instance mediation settings classes. Using a instance mediation settings class involves:

  • Creating an instance of the mediation settings class for ad networks that may be loaded for your ad unit ID.
  • Configuring the properties on the objects.
  • Passing them inside an array when loading a rewarded video.

Look in the same directory as your ad network’s custom event to see what mediation settings objects exist for the network.

The following code snippets demonstrate the above steps in the context of a game application; specifically, how to pre-fetch a rewarded video and display it after a level has ended.

// AppDelegate.h
#import <UIKit/UIKit.h>
#import "MoPub.h"
#import "MPRewardedVideo.h"

@interface AppDelegate : UIResponder <UIApplicationDelegate, MPRewardedVideoDelegate>

@property (strong, nonatomic) UIWindow *window;
// Our user's current coin amount.
@property (nonatomic, assign) NSInteger coinAmount;


// AppDelegate.m
@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // … your -application:didFinishLaunchingWithOptions: code …
    [self loadRewardedVideo];

    return YES;

- (void)loadRewardedVideo {
    // Initialize rewarded video before loading any ads.
    [[MoPub sharedInstance] initializeRewardedVideoWithGlobalMediationSettings:nil delegate:self];

    // Fetch the rewarded video ad.
    [MPRewardedVideo loadRewardedVideoAdWithAdUnitID:@"[Placeholder Ad Unit ID]" withMediationSettings:nil];

#pragma mark - MPRewardedVideoDelegate

- (void)rewardedVideoAdShouldRewardForAdUnitID:(NSString *)adUnitID reward:(MPRewardedVideoReward *)reward {
    // You define the reward's currency type on your ad network's portal.
    // We have defined coin as a currency type and will increment the user's coin amount when we receive a reward with coin as
    // the currency type.
    if ([reward.currencyType isEqualToString:@"coin"]) {
        if ([reward.amount integerValue] == kMPRewardedVideoRewardCurrencyAmountUnspecified
) {
            // Come up with your own reward amount.
        } else {
            self.coinAmount += [reward.amount integerValue];

// … other MPRewardedVideoDelegate delegate methods…


// MyViewController.m
#import "MyViewController.h"

@implementation MyViewController
// … your view controller code …

// Present the ad only after it is ready.
- (void)levelDidEnd {
    if ([MPRewardedVideo hasAdAvailableForAdUnitID:@"[Placeholder Ad Unit ID]"]) {
        [MPRewardedVideo presentRewardedVideoAdForAdUnitID:@"[Placeholder Ad Unit ID]" fromViewController:self];
    } else {
        // The rewarded video wasn't ready, so continue as usual.


Advanced: Mediated Network Pre-initialization

To mediated ad load performance, the call to -initializeRewardedVideoWithGlobalMediationSettings:delegate: will automatically pre-initialize all known rewarded video network SDKs with the last cached initialization parameters. By pre-initializing the network SDKs, this gives the network the necessary lead time between SDK initialization and ad request to ensure a successful ad request. Every successful call to requestRewardedVideoWithCustomEventInfo: will update the initialization parameters in the cache for that network.

If pre-initializing all cached rewarded network SDKs is not desired, you can call -initializeRewardedVideoWithGlobalMediationSettings:delegate:networkInitializationOrder: and pass in an array of rewarded networks to pre-initialize. The networks will be initialized in the order passed in.

Note: The existing on-demand network SDK initialization can be combined with this partial pre-initialization call.

An example of a partial pre-initialization is shown below:

// AppDelegate.m
@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // … your -application:didFinishLaunchingWithOptions: code …

    // Initialize rewarded video before loading any ads and pre-initialize the following networks:
    // 1. Chartboost
    // 2. Tapjoy
    // 3. Vungle
    NSArray * initializationOrder = @[
    [[MoPub sharedInstance] initializeRewardedVideoWithGlobalMediationSettings:nil

    return YES;

It is also possible to completely opt-out of network SDK pre-initialization. This can be achieved by passing nil into the networkInitializationOrder parameter. An example is shown below:

// AppDelegate.m
@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // … your -application:didFinishLaunchingWithOptions: code …

    // Initialize rewarded video before loading any ads and opt-out of pre-initializion
    [[MoPub sharedInstance] initializeRewardedVideoWithGlobalMediationSettings:nil

    return YES;

Advanced: Passing Custom Data

There may be cases where your reward server will need additional information to determine an appropriate reward for the user. When the rewarded video is presented, the app can call +presentRewardedVideoAdForAdUnitID:fromViewController:withReward:customData:, and include an optional string containing custom data. The optional custom data will be sent as part of the URL in the server-to-server callback.


  • It is recommended that the custom data string not exceed 8kb in size as this will significantly degrade performance. Try to keep the custom data payload as small as possible.
  • Custom data will only be passed if the ad unit has been setup with a server side callback.

In addition to specifying the custom data at presentation time, the server-side callback URL in the MoPub dashboard will also need to include a query parameter that uses the %%CUSTOM_DATA%% macro. For example:

Last updated March 07, 2018

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.

© 2018 MoPub Inc.