Ad Formats
This guide covers the implementation of different ad formats available in MAS SDK for iOS platforms.
- App Open Ads
- Rewarded Video
- Interstitial
- Banner
- Native
App open ads appear when the user opens your app or switches back to your app. They are displayed on the loading or splash screen.
Benefits
- An ad overlays the loading screen
- The unique app open ad layout offers the best user experience for this placement
- Unlock new inventory: monetize users as soon as they open your app
- Maximize demands
- Highest bidding ad creatives
- Availability of both full-screen and partial-screen ads
- Optimized user experience rendering
Setup the Auto Delay Load
Loading a new ad from OnAdLoadFailedEvent()
without delay is not recommended.
If a new ad has to be loaded immediately on OnAdLoadFailedEvent()
, then the auto-delay configuration variable must be set to true to limit ad load retries, thus avoiding continuous failed ad requests and ANR issues.
- Swift
- Objective-C
// Remember to call this function before SDK init.
Yodo1MasAppOpenAd.sharedInstance().autoDelayIfLoadFail = true
// Remember to call this function before SDK init.
[Yodo1MasAppOpenAd sharedInstance].autoDelayIfLoadFail = YES;
Implementation
- Swift
- Objective-C
// Load the ad
Yodo1MasAppOpenAd.sharedInstance().load()
// Check if ad is loaded
let isLoaded = Yodo1MasAppOpenAd.sharedInstance().isLoaded()
// Show ad without placement name
if isLoaded { Yodo1MasAppOpenAd.sharedInstance().show() }
// Show ad with placement name
if isLoaded { Yodo1MasAppOpenAd.sharedInstance().show(withPlacement: "Your placement ID") }
// Load the ad
[[Yodo1MasAppOpenAd sharedInstance] loadAd];
// Check if ad is loaded
BOOL isLoaded = [[Yodo1MasAppOpenAd sharedInstance] isLoaded];
// Show ad without placement name
if (isLoaded) [[Yodo1MasAppOpenAd sharedInstance] showAd];
// Show ad with placement name
if (isLoaded) [[Yodo1MasAppOpenAd sharedInstance] showAdWithPlacement:@"Your placement ID"];
Events
- Swift
- Objective-C
Yodo1MasAppOpenAd.sharedInstance().delegate = self
func onAppOpenAdLoaded(_ ad: Yodo1MasAppOpenAd) {
print("[Yodo1 Mas] App Open ad loaded")
}
func onAppOpenAdFailedToLoad(_ ad: Yodo1MasAppOpenAd, _ error: Yodo1MasError) {
print("[Yodo1 Mas] App Open ad failed to load")
}
func onAppOpenAdOpened(_ ad: Yodo1MasAppOpenAd) {
print("[Yodo1 Mas] App Open ad opened")
}
func onAppOpenAdFailedToOpen(_ ad: Yodo1MasAppOpenAd, _ error: Yodo1MasError) {
print("[Yodo1 Mas] App Open ad failed to open")
}
func onAppOpenAdClosed(_ ad: Yodo1MasAppOpenAd) {
print("[Yodo1 Mas] App Open ad closed")
}
[Yodo1MasAppOpenAd sharedInstance].delegate = self;
#pragma mark - Yodo1MasAppOpenAdDelegate
- (void)onAppOpenAdLoaded:(Yodo1MasAppOpenAd *)ad {
NSLog(@"[Yodo1 Mas] App Open ad loaded");
}
- (void)onAppOpenAdFailedToLoad:(Yodo1MasAppOpenAd *)ad withError:(Yodo1MasError *)error {
NSLog(@"[Yodo1 Mas] App Open ad failed to load");
}
- (void)onAppOpenAdOpened:(Yodo1MasAppOpenAd *)ad {
NSLog(@"[Yodo1 Mas] App Open ad opened");
}
- (void)onAppOpenAdFailedToOpen:(Yodo1MasAppOpenAd *)ad withError:(Yodo1MasError *)error {
NSLog(@"[Yodo1 Mas] App Open ad failed to open");
}
- (void)onAppOpenAdClosed:(Yodo1MasAppOpenAd *)ad {
NSLog(@"[Yodo1 Mas] App Open ad closed");
}
Impression-Level User Revenue
Impression-level user revenue data allows you to access detailed revenue information for each ad impression. This data can be used to compare different sources and campaigns, and to share impression-level ad revenue data with your mobile measurement partner of choice.
You can retrieve the revenue amount in all ad lifecycle callbacks. The following example shows how to do this within a callback:
- Swift
- Objective-C
Yodo1MasAppOpenAd.sharedInstance().adRevenueDelegate = self
func onAppOpenAdPayRevenue(_ ad: Yodo1MasAppOpenAd, _ adValue: Yodo1MasAdValue) {
let revenue = adValue.revenue
let currency = adValue.currency
let revenuePrecision = adValue.revenuePrecision
}
[Yodo1MasAppOpenAd sharedInstance].adRevenueDelegate = self;
#pragma mark - Yodo1MasAppOpenAdRevenueDelegate
- (void)onAppOpenAdPayRevenue:(Yodo1MasAppOpenAd *)ad withAdValue:(Yodo1MasAdValue *)adValue {
double revenue = adValue.revenue;
NSString *currency = adValue.currency;
NSString *revenuePrecision = adValue.revenuePrecision;
}
The revenuePrecision
takes one of the following values:
- "publisher_defined": the revenue amount is the price assigned by the publisher
- "exact": the revenue amount is the result of a real-time auction
- "estimated": the revenue amount is based on Auto-CPM or FB Bidding estimates
- "": revenue and precision are not valid (for example, in test mode)
Rewarded video ads enable users to earn in-app rewards by watching video ads.
Benefits
- Increase revenue with highest eCPM rates
- Increase in-app purchases
- Increase user engagement and retention
Setup the Auto Delay Load
Loading a new ad from OnAdLoadFailedEvent()
without delay is not recommended.
If a new ad has to be loaded immediately on OnAdLoadFailedEvent()
, then the auto-delay configuration variable must be set to true to limit ad load retries, thus avoiding continuous failed ad requests and ANR issues.
- Swift
- Objective-C
// Remember to call this function before SDK init.
Yodo1MasRewardAd.sharedInstance().autoDelayIfLoadFail = true
// Remember to call this function before SDK init.
[Yodo1MasRewardAd sharedInstance].autoDelayIfLoadFail = YES;
Implementation
- Swift
- Objective-C
// Load the ad
Yodo1MasRewardAd.sharedInstance().load()
// Check if ad is loaded
let isLoaded = Yodo1MasRewardAd.sharedInstance().isLoaded()
// Show ad without placement name
if isLoaded { Yodo1MasRewardAd.sharedInstance().show() }
// Show ad with placement name
if isLoaded { Yodo1MasRewardAd.sharedInstance().show(withPlacement: "Your placement ID") }
// Load the ad
[[Yodo1MasRewardAd sharedInstance] loadAd];
// Check if ad is loaded
BOOL isLoaded = [[Yodo1MasRewardAd sharedInstance] isLoaded];
// Show ad without placement name
if (isLoaded) [[Yodo1MasRewardAd sharedInstance] showAd];
// Show ad with placement name
if (isLoaded) [[Yodo1MasRewardAd sharedInstance] showAdWithPlacement:@"Your placement ID"];
Events
- Swift
- Objective-C
Yodo1MasRewardAd.sharedInstance().delegate = self
func onRewardAdLoaded(_ ad: Yodo1MasRewardAd) {
print("[Yodo1 Mas] Reward ad loaded")
}
func onRewardAdFailedToLoad(_ ad: Yodo1MasRewardAd, _ error: Yodo1MasError) {
print("[Yodo1 Mas] Reward ad failed to load")
}
func onRewardAdOpened(_ ad: Yodo1MasRewardAd) {
print("[Yodo1 Mas] Reward ad opened")
}
func onRewardAdFailedToOpen(_ ad: Yodo1MasRewardAd, _ error: Yodo1MasError) {
print("[Yodo1 Mas] Reward ad failed to open")
}
func onRewardAdClosed(_ ad: Yodo1MasRewardAd) {
print("[Yodo1 Mas] Reward ad closed")
}
func onRewardAdEarned(_ ad: Yodo1MasRewardAd) {
print("[Yodo1 Mas] Reward ad earned")
}
[Yodo1MasRewardAd sharedInstance].delegate = self;
#pragma mark - Yodo1MasRewardAdDelegate
- (void)onRewardAdLoaded:(Yodo1MasRewardAd *)ad {
NSLog(@"[Yodo1 Mas] Reward ad loaded");
}
- (void)onRewardAdFailedToLoad:(Yodo1MasRewardAd *)ad withError:(Yodo1MasError *)error {
NSLog(@"[Yodo1 Mas] Reward ad failed to load");
}
- (void)onRewardAdOpened:(Yodo1MasRewardAd *)ad {
NSLog(@"[Yodo1 Mas] Reward ad opened");
}
- (void)onRewardAdFailedToOpen:(Yodo1MasRewardAd *)ad withError:(Yodo1MasError *)error {
NSLog(@"[Yodo1 Mas] Reward ad failed to open");
}
- (void)onRewardAdClosed:(Yodo1MasRewardAd *)ad {
NSLog(@"[Yodo1 Mas] Reward ad closed");
}
- (void)onRewardAdEarned:(Yodo1MasRewardAd *)ad {
NSLog(@"[Yodo1 Mas] Reward ad earned");
}
Impression-Level User Revenue
- Swift
- Objective-C
Yodo1MasRewardAd.sharedInstance().adRevenueDelegate = self
func onRewardAdPayRevenue(_ ad: Yodo1MasRewardAd, _ adValue: Yodo1MasAdValue) {
let revenue = adValue.revenue
let currency = adValue.currency
let revenuePrecision = adValue.revenuePrecision
}
[Yodo1MasRewardAd sharedInstance].adRevenueDelegate = self;
#pragma mark - Yodo1MasRewardAdRevenueDelegate
- (void)onRewardAdPayRevenue:(Yodo1MasRewardAd *)ad withAdValue:(Yodo1MasAdValue *)adValue {
double revenue = adValue.revenue;
NSString *currency = adValue.currency;
NSString *revenuePrecision = adValue.revenuePrecision;
}
Interstitial ads are full-screen ads that appear at natural transition points in your app.
Benefits
- Engaging full-screen content
- Media content can be static, video-based or interactive
- Positive UX when placed at natural transition points
Setup the Auto Delay Load
Loading a new ad from OnAdLoadFailedEvent()
without delay is not recommended.
If a new ad has to be loaded immediately on OnAdLoadFailedEvent()
, then the auto-delay configuration variable must be set to true to limit ad load retries, thus avoiding continuous failed ad requests and ANR issues.
- Swift
- Objective-C
// Remember to call this function before SDK init.
Yodo1MasInterstitialAd.sharedInstance().autoDelayIfLoadFail = true
// Remember to call this function before SDK init.
[Yodo1MasInterstitialAd sharedInstance].autoDelayIfLoadFail = YES;
Implementation
- Swift
- Objective-C
// Load the ad
Yodo1MasInterstitialAd.sharedInstance().load()
// Check if ad is loaded
let isLoaded = Yodo1MasInterstitialAd.sharedInstance().isLoaded()
// Show ad without placement name
if isLoaded { Yodo1MasInterstitialAd.sharedInstance().show() }
// Show ad with placement name
if isLoaded { Yodo1MasInterstitialAd.sharedInstance().show(withPlacement: "Your placement ID") }
// Load the ad
[[Yodo1MasInterstitialAd sharedInstance] loadAd];
// Check if ad is loaded
BOOL isLoaded = [[Yodo1MasInterstitialAd sharedInstance] isLoaded];
// Show ad without placement name
if (isLoaded) [[Yodo1MasInterstitialAd sharedInstance] showAd];
// Show ad with placement name
if (isLoaded) [[Yodo1MasInterstitialAd sharedInstance] showAdWithPlacement:@"Your placement ID"];
Events
- Swift
- Objective-C
Yodo1MasInterstitialAd.sharedInstance().delegate = self
func onInterstitialAdLoaded(_ ad: Yodo1MasInterstitialAd) {
print("[Yodo1 Mas] Interstitial ad loaded")
}
func onInterstitialAdFailedToLoad(_ ad: Yodo1MasInterstitialAd, _ error: Yodo1MasError) {
print("[Yodo1 Mas] Interstitial ad failed to load")
}
func onInterstitialAdOpened(_ ad: Yodo1MasInterstitialAd) {
print("[Yodo1 Mas] Interstitial ad opened")
}
func onInterstitialAdFailedToOpen(_ ad: Yodo1MasInterstitialAd, _ error: Yodo1MasError) {
print("[Yodo1 Mas] Interstitial ad failed to open")
}
func onInterstitialAdClosed(_ ad: Yodo1MasInterstitialAd) {
print("[Yodo1 Mas] Interstitial ad closed")
}
[Yodo1MasInterstitialAd sharedInstance].delegate = self;
#pragma mark - Yodo1MasInterstitialAdDelegate
- (void)onInterstitialAdLoaded:(Yodo1MasInterstitialAd *)ad {
NSLog(@"[Yodo1 Mas] Interstitial ad loaded");
}
- (void)onInterstitialAdFailedToLoad:(Yodo1MasInterstitialAd *)ad withError:(Yodo1MasError *)error {
NSLog(@"[Yodo1 Mas] Interstitial ad failed to load");
}
- (void)onInterstitialAdOpened:(Yodo1MasInterstitialAd *)ad {
NSLog(@"[Yodo1 Mas] Interstitial ad opened");
}
- (void)onInterstitialAdFailedToOpen:(Yodo1MasInterstitialAd *)ad withError:(Yodo1MasError *)error {
NSLog(@"[Yodo1 Mas] Interstitial ad failed to open");
}
- (void)onInterstitialAdClosed:(Yodo1MasInterstitialAd *)ad {
NSLog(@"[Yodo1 Mas] Interstitial ad closed");
}
Impression-Level User Revenue
- Swift
- Objective-C
Yodo1MasInterstitialAd.sharedInstance().adRevenueDelegate = self
func onInterstitialAdPayRevenue(_ ad: Yodo1MasInterstitialAd, _ adValue: Yodo1MasAdValue) {
let revenue = adValue.revenue
let currency = adValue.currency
let revenuePrecision = adValue.revenuePrecision
}
[Yodo1MasInterstitialAd sharedInstance].adRevenueDelegate = self;
#pragma mark - Yodo1MasInterstitialAdRevenueDelegate
- (void)onInterstitialAdPayRevenue:(Yodo1MasInterstitialAd *)ad withAdValue:(Yodo1MasAdValue *)adValue {
double revenue = adValue.revenue;
NSString *currency = adValue.currency;
NSString *revenuePrecision = adValue.revenuePrecision;
}
Banner ads are rectangular ads that occupy a portion of an app's layout and can refresh automatically.
Benefits
- Banner Ads are among the oldest advertisements and can make instant impressions at a relatively low cost.
- Banner Ads offer a quick, easy, and cost-effective way to generate immediate interest.
- Banner Ads can pique viewers' curiosity and help retain them by promoting brand awareness.
Setup the Auto Delay Load
Loading a new ad from OnAdLoadFailedEvent()
without delay is not recommended.
If a new ad has to be loaded immediately on OnAdLoadFailedEvent()
, then the auto-delay configuration variable must be set to true to limit ad load retries, thus avoiding continuous failed ad requests and ANR issues.
- Swift
- Objective-C
// Remember to call this function before SDK init.
Yodo1MasBannerAd.sharedInstance().autoDelayIfLoadFail = true
// Remember to call this function before SDK init.
[Yodo1MasBannerAd sharedInstance].autoDelayIfLoadFail = YES;
Implementation
- Swift
- Objective-C
// Using Interface Builder
@IBOutlet weak var bannerAdView: Yodo1MasBannerAdView!
bannerAdView.loadAd()
// Using Code
let bannerAdView = Yodo1MasBannerAdView(frame: CGRect(x: 0, y: 0, width: 320, height: 50))
self.view.addSubview(bannerAdView)
bannerAdView.loadAd()
// Using Interface Builder
@property (weak, nonatomic) IBOutlet Yodo1MasBannerAdView *bannerAdView;
[_bannerAdView loadAd];
// Using Code
Yodo1MasBannerAdView *bannerAdView = [[Yodo1MasBannerAdView alloc] initWithFrame:CGRectMake(0, 0, 320, 50)];
[self.view addSubview:bannerAdView];
[bannerAdView loadAd];
Events
- Swift
- Objective-C
bannerAdView.delegate = self
func onBannerAdLoaded(_ ad: Yodo1MasBannerAdView) {
print("[Yodo1 Mas] Banner ad loaded")
}
func onBannerAdFailedToLoad(_ ad: Yodo1MasBannerAdView, _ error: Yodo1MasError) {
print("[Yodo1 Mas] Banner ad failed to load")
}
func onBannerAdOpened(_ ad: Yodo1MasBannerAdView) {
print("[Yodo1 Mas] Banner ad opened")
}
func onBannerAdFailedToOpen(_ ad: Yodo1MasBannerAdView, _ error: Yodo1MasError) {
print("[Yodo1 Mas] Banner ad failed to open")
}
func onBannerAdClosed(_ ad: Yodo1MasBannerAdView) {
print("[Yodo1 Mas] Banner ad closed")
}
bannerAdView.delegate = self;
#pragma mark - Yodo1MasBannerAdDelegate
- (void)onBannerAdLoaded:(Yodo1MasBannerAdView *)ad {
NSLog(@"[Yodo1 Mas] Banner ad loaded");
}
- (void)onBannerAdFailedToLoad:(Yodo1MasBannerAdView *)ad withError:(Yodo1MasError *)error {
NSLog(@"[Yodo1 Mas] Banner ad failed to load");
}
- (void)onBannerAdOpened:(Yodo1MasBannerAdView *)ad {
NSLog(@"[Yodo1 Mas] Banner ad opened");
}
- (void)onBannerAdFailedToOpen:(Yodo1MasBannerAdView *)ad withError:(Yodo1MasError *)error {
NSLog(@"[Yodo1 Mas] Banner ad failed to open");
}
- (void)onBannerAdClosed:(Yodo1MasBannerAdView *)ad {
NSLog(@"[Yodo1 Mas] Banner ad closed");
}
Impression-Level User Revenue
- Swift
- Objective-C
bannerAdView.adRevenueDelegate = self
func onBannerAdPayRevenue(_ ad: Yodo1MasBannerAdView, _ adValue: Yodo1MasAdValue) {
let revenue = adValue.revenue
let currency = adValue.currency
let revenuePrecision = adValue.revenuePrecision
}
bannerAdView.adRevenueDelegate = self;
#pragma mark - Yodo1MasBannerAdRevenueDelegate
- (void)onBannerAdPayRevenue:(Yodo1MasBannerAdView *)ad withAdValue:(Yodo1MasAdValue *)adValue {
double revenue = adValue.revenue;
NSString *currency = adValue.currency;
NSString *revenuePrecision = adValue.revenuePrecision;
}
Native ads allow you to customize the ad experience by blending it directly into your app's UI.
Benefits
- Better eCPMs than Banners
- Positive impact on retention
- Customizable to match your app's UI
Setup the Auto Delay Load
Loading a new ad from OnAdLoadFailedEvent()
without delay is not recommended.
If a new ad has to be loaded immediately on OnAdLoadFailedEvent()
, then the auto-delay configuration variable must be set to true to limit ad load retries, thus avoiding continuous failed ad requests and ANR issues.
- Swift
- Objective-C
// Remember to call this function before SDK init.
Yodo1MasNativeAd.sharedInstance().autoDelayIfLoadFail = true
// Remember to call this function before SDK init.
[Yodo1MasNativeAd sharedInstance].autoDelayIfLoadFail = YES;
Implementation
- Swift
- Objective-C
// Using Interface Builder
@IBOutlet weak var nativeAdView: Yodo1MasNativeAdView!
nativeAdView.loadAd()
// Using Code
let nativeAdView = Yodo1MasNativeAdView(frame: CGRect(x: 0, y: 0, width: 320, height: 300))
self.view.addSubview(nativeAdView)
nativeAdView.loadAd()
// Using Interface Builder
@property (weak, nonatomic) IBOutlet Yodo1MasNativeAdView *nativeAdView;
[_nativeAdView loadAd];
// Using Code
Yodo1MasNativeAdView *nativeAdView = [[Yodo1MasNativeAdView alloc] initWithFrame:CGRectMake(0, 0, 320, 300)];
[self.view addSubview:nativeAdView];
[nativeAdView loadAd];
Events
- Swift
- Objective-C
nativeAdView.delegate = self
func onNativeAdLoaded(_ ad: Yodo1MasNativeAdView) {
print("[Yodo1 Mas] Native ad loaded")
}
func onNativeAdFailedToLoad(_ ad: Yodo1MasNativeAdView, _ error: Yodo1MasError) {
print("[Yodo1 Mas] Native ad failed to load")
}
func onNativeAdOpened(_ ad: Yodo1MasNativeAdView) {
print("[Yodo1 Mas] Native ad opened")
}
func onNativeAdFailedToOpen(_ ad: Yodo1MasNativeAdView, _ error: Yodo1MasError) {
print("[Yodo1 Mas] Native ad failed to open")
}
func onNativeAdClosed(_ ad: Yodo1MasNativeAdView) {
print("[Yodo1 Mas] Native ad closed")
}
nativeAdView.delegate = self;
#pragma mark - Yodo1MasNativeAdDelegate
- (void)onNativeAdLoaded:(Yodo1MasNativeAdView *)ad {
NSLog(@"[Yodo1 Mas] Native ad loaded");
}
- (void)onNativeAdFailedToLoad:(Yodo1MasNativeAdView *)ad withError:(Yodo1MasError *)error {
NSLog(@"[Yodo1 Mas] Native ad failed to load");
}
- (void)onNativeAdOpened:(Yodo1MasNativeAdView *)ad {
NSLog(@"[Yodo1 Mas] Native ad opened");
}
- (void)onNativeAdFailedToOpen:(Yodo1MasNativeAdView *)ad withError:(Yodo1MasError *)error {
NSLog(@"[Yodo1 Mas] Native ad failed to open");
}
- (void)onNativeAdClosed:(Yodo1MasNativeAdView *)ad {
NSLog(@"[Yodo1 Mas] Native ad closed");
}
Impression-Level User Revenue
- Swift
- Objective-C
nativeAdView.adRevenueDelegate = self
func onNativeAdPayRevenue(_ ad: Yodo1MasNativeAdView, _ adValue: Yodo1MasAdValue) {
let revenue = adValue.revenue
let currency = adValue.currency
let revenuePrecision = adValue.revenuePrecision
}
nativeAdView.adRevenueDelegate = self;
#pragma mark - Yodo1MasNativeAdRevenueDelegate
- (void)onNativeAdPayRevenue:(Yodo1MasNativeAdView *)ad withAdValue:(Yodo1MasAdValue *)adValue {
double revenue = adValue.revenue;
NSString *currency = adValue.currency;
NSString *revenuePrecision = adValue.revenuePrecision;
}