Search...
Menu

Rewarded Video Ads

💡Tips

  • 🚀 Smart Cache automatically manages multi-placement parallel loading and cache comparison — no need to manually manage multiple MCRewardedAd instances
  • ⚠️ MCRewardAdManager is a normal instance class; recommended to hold as a property
  • 🔧 Use the smartCacheDidRewardUserForAd:withReward: callback to confirm reward distribution — this is the only reliable reward delivery trigger

objective-c Copy
#import <MCSDK/MCSDK.h>

@interface SmartCacheRewardedVC () <MCSmartCacheDelegate>

@property (nonatomic, strong) MCRewardAdManager *rewardManager;

@end

@implementation SmartCacheRewardedVC

#pragma mark - Load Ad
- (void)loadAd {
    if (!self.rewardManager) {
        self.rewardManager = [[MCRewardAdManager alloc] init];
    }
    // Set delegate before the first loadAd call
    self.rewardManager.delegate = self;
    [self.rewardManager loadAd];
}

#pragma mark - MCSmartCacheDelegate
// At least one ad in cache pool is ready
- (void)smartCacheDidLoadAd:(MCAdInfo *)ad {

}

// All placements failed in first round (mutually exclusive with smartCacheDidLoadAd:)
- (void)smartCacheDidFailToLoadAdWithError:(MCError *)error {

}

// Current round loading completed
- (void)smartCacheDidAdLoadFinished {

}

// Ad displayed successfully
- (void)smartCacheDidDisplayAd:(MCAdInfo *)ad {

}

// Ad closed; SDK auto-replenishes
- (void)smartCacheDidHideAd:(MCAdInfo *)ad {

}

// Ad clicked
- (void)smartCacheDidClickAd:(MCAdInfo *)ad {

}

// Ad display failed
- (void)smartCacheDidFailToDisplayAd:(MCAdInfo *)ad withError:(MCError *)error {

}

// Revenue callback
- (void)smartCacheDidPayRevenueForAd:(MCAdInfo *)ad {

}

// User met reward conditions (the only reliable reward delivery trigger)
- (void)smartCacheDidRewardUserForAd:(MCAdInfo *)ad withReward:(MCReward *)reward {

}

// Video started playing
- (void)smartCacheDidAdVideoStarted:(MCAdInfo *)ad {

}

// Video playback completed
- (void)smartCacheDidAdVideoCompleted:(MCAdInfo *)ad {

}

objective-c Copy
if ([self.rewardManager isReady]) {
    [self.rewardManager showAdWithViewController:self];
}

To pass a scene ID or other extra parameters:

objective-c Copy
if ([self.rewardManager isReady]) {
    [self.rewardManager showAdWithViewController:self
                                       withExtra:@{kMCAPIPlacementScenarioIDKey: @"your scene id"}];
}

3. Reward Distribution

Use the MCSmartCacheDelegate callback to confirm reward distribution:

objective-c Copy
// User met reward conditions
- (void)smartCacheDidRewardUserForAd:(MCAdInfo *)ad withReward:(MCReward *)reward {
    // Grant reward here
}

Rewarded video auxiliary callbacks:

objective-c Copy
// Video started playing
- (void)smartCacheDidAdVideoStarted:(MCAdInfo *)ad { }

// Video playback completed
- (void)smartCacheDidAdVideoCompleted:(MCAdInfo *)ad { }

4. Release Resources

objective-c Copy
[self.rewardManager destroyAd];

Call destroyAd when the page or module is destroyed to release cache pool resources and avoid memory leaks. After release, loadAd must be called again to continue using.


5. Custom Parameter Configuration

objective-c Copy
- (void)loadAd {
    if (!self.rewardManager) {
        self.rewardManager = [[MCRewardAdManager alloc] init];
    }
    self.rewardManager.delegate = self;

    // Set load extra parameters; call before loadAd
    [self.rewardManager setLoadExtraParameter:@{
        @"userID": @"test_userId",
        @"userData": @"test_userData"
    }];

    // Set mediation extra parameters; call before loadAd
    [self.rewardManager setExtraParameter:@{
        @"test_extra_key": @"test_extra_value"
    }];

    [self.rewardManager loadAd];
}
Last modified: 2026-04-03Powered by