Difference between revisions of "IOS AdMM"

From AdLocus
Jump to: navigation, search
(Created page with "== 前言 == 我們提供您透過 AdMob Mediation 來管理 InApp 的廣告版位。 == 專案設定 == *  將『AdMob Mediation Adapterr』...")
 
 
(2 intermediate revisions by one other user not shown)
Line 3: Line 3:
  
 
== 專案設定 ==
 
== 專案設定 ==
−
*  將『[[Media:IOSAdLocusAdapter.zip|AdMob Mediation Adapter]]r』『[https://developers.google.com/admob/ios/download Google Mobile Ads SDK]』『[[Media:LibAdLocus_SDK_4_0_15.zip|AdLocus SDK]]』加入您的專案
+
*  將『[[Media:IOSAdLocusAdapter.zip|AdMob Mediation Adapter]]』『[https://developers.google.com/admob/ios/download Google Mobile Ads SDK]』『[[Media:LibAdLocus_SDK_4_0_15.zip|AdLocus SDK]]』加入您的專案
 
[[File:Ios_mediation_project_step.jpg]]
 
[[File:Ios_mediation_project_step.jpg]]
 +
 +
* 在ViewController中加入以下程式碼
 +
<syntaxhighlight lang="c">
 +
/***************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
 +
</syntaxhighlight>
  
 
== AdMob 設定 ==
 
== AdMob 設定 ==

Latest revision as of 14:56, 7 September 2015

前言

我們提供您透過 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 的廣告.