IOS AdMM

From AdLocus
Jump to: navigation, search

前言

我們提供您透過 AdMob Mediation 來管理 InApp 的廣告版位。

專案設定

Ios mediation project step.jpg

  • 在ViewController中加入以下程式碼
/***************ViewController.h****************/
#import <UIKit/UIKit.h>
#import "GoogleMobileAds/GADInterstitial.h"
@class GADBannerView;
 
@interface ViewController : UIViewController<GADBannerViewDelegate, GADInterstitialDelegate>
 
@property(nonatomic, weak) IBOutlet GADBannerView *bannerView;
@property (nonatomic, retain) GADInterstitial *interstitialView;
 
@end
 
 
/***************ViewController.m****************/
@import GoogleMobileAds;
 
#import "ViewController.h"
 
@implementation ViewController
 
- (void)viewDidLoad
{
  [super viewDidLoad];
  [self GADBanner];
 
}
 
-(void)GADBanner
{
    self.bannerView.adUnitID = @"your ad unit ID";
    self.bannerView.rootViewController = self;
    GADRequest *request = [GADRequest request];
 
    //request.testDevices = @[@"your device id"];
    [self.bannerView loadRequest:request];
}
 
 
 
@end

AdMob 設定

  • 在 App 的 [設定頁面] 中, 點選 [編輯中介服務]
 Mediation3.jpg
  • 在 [中介服務] 中, 點選 [新增廣告聯播網]
  • 在 [廣告聯播網] 中, 點選 [新增自訂事件]
 Mediation2.jpg
  • ClassName 輸入: com.adlocus.AdLocusAdapter
  • Parameter 輸入: 您的AdLocus APP Key
  • Label 輸入: AdLocus
  • 選擇 [繼續]
 Mediation1.jpg
  • 儲存後, 在 [中介服務] 中, 調整 AdLocus 的 CPM 為 1.00 USD, 可優先取得 AdLocus 的廣告.