Chartboost Videos
Boost your game with engaging, high-quality video ads!
The Chartboost SDK offers rich media support, custom advertiser experiences, and refreshed end cards to make your videos feel less like ads and more like crafted recommendations. Give your players the best in-game experience to enhance your ad performance and drive higher eCPM.
Chartboost offers two types of video ads:
-
Rewarded video lets players earn in-game items or virtual currency in exchange for a completed video view.
-
Interstitial video earns you revenue or helps you acquire users similarly to static creatives.
Before You Begin π
- Download and integrate the latest Chartboost SDK.
- Start a campaign in your dashboard.
Prefetched videos (in total) only take up 30-50MB, even when you are using mediation. Video prefetch might download videos from campaigns that hit budget, in which case a βNo Ad Foundβ error might occur.
Rewarded Video Integration π
To create a rewarded ad you use the initializer initWithLocation:delegate: providing a Chartboost location and an optional delegate.
-
rewarded = CHBRewarded(location: "MainMenu", delegate: self) -
CHBRewarded *rewarded = [[CHBRewarded alloc] initWithLocation:@"MainMenu" delegate:self];
Rewarded ads need to be cached before they can be shown. To cache a rewarded ad, call the cache method.
-
rewarded.cache() -
[rewarded cache];
To show a rewarded ad, call the show method.
-
rewarded.show(from: self) -
[rewarded showFromViewController:self];
Learn more about delegate methods
Interstitial Video Integration π
To create an interstitial ad you use the initializer initWithLocation:delegate: providing a Chartboost location and an optional delegate.
-
interstitial = CHBInterstitial(location: "MainMenu", delegate: self) -
CHBInterstitial *interstitial = [[CHBInterstitial alloc] initWithLocation:@"MainMenu" delegate:self];
Interstitial video ads need to be cached before they can be shown. To cache an interstitial video ad just call the cache method.
-
interstitial.cache() -
[interstitial cache];
To show an interstitial video ad just call the show method.
-
interstitial.show(from: self) -
[interstitial showFromViewController:self];
Custom Rewarded Video Behavior π
To check if a video is available at either location, show the appropriate prompt before playing the video, and give the appropriate reward afterward, use the following:
isCached property is deprecated and will be removed in a future SDK release. Additional condition checks have been added to cache() and show() calls making this property redundant. Remove isCached checks and call show(from:) directly; the SDK will handle the uncached case.
-
// Preload videos at BOTH named locations networkRewardedAd = CHBRewarded(location: "NetworkVideo", delegate: self) crossPromoRewardedAd = CHBRewarded(location: "CrossPromo", delegate: self) networkRewardedAd.cache() crossPromoRewardedAd.cache() // When the user triggers the rewarded ad offer, call show(from:) directly. // The SDK handles the uncached case internally β no isCached check is needed. // We prefer to use the monetizing video if available; fall back to cross-promo. // Call your custom UI prompt and, if accepted, show the ad: networkRewardedAd.show(from: self) // or crossPromoRewardedAd.show(from: self) -
// Preload videos at BOTH named locations networkRewardedAd = [[CHBRewarded alloc] initWithLocation:@"NetworkVideo" delegate:self]; crossPromoRewardedAd = [[CHBRewarded alloc] initWithLocation:@"CrossPromo" delegate:self]; [networkRewardedAd cache]; [crossPromoRewardedAd cache]; // When the user triggers the rewarded ad offer, call showFromViewController: directly. // The SDK handles the uncached case internally β no isCached check is needed. // We prefer to use the monetizing video if available; fall back to cross-promo. // Call your custom UI prompt and, if accepted, show the ad: [networkRewardedAd showFromViewController:self]; // or [crossPromoRewardedAd showFromViewController:self];
After the player watches the video, check the location where your gameβs rewarded video delegate method is called:
-
func didEarnReward(_ event: CHBRewardEvent) { // The event.reward value is what is set on the app's dashboard, which we are overriding if event.ad.location == "NetworkVideo" { // give your user the NetworkVideo reward } else { // give your user the CrossPromo reward } } -
- (void)didEarnReward:(CHBRewardEvent *)event { // The event.reward value is what is set on the app's dashboard, which we are overriding if ([event.ad.location isEqual:@"NetworkVideo"]) { // give your user the NetworkVideo reward } else { // give your user the CrossPromo reward } }