1. 需要有一個google account
2. 用google account登入,開始申請AdMob。填入一些基本資料。
3. 設定帳戶資料,選擇付款方式(我是用Paypal)
帳戶類型:個人
企業名稱:(個人姓名)
本地稅務ID:(身分證字號)
付款詳細資料:輸入Paypal的帳號
4. 新增網站/應用程式
選擇應用程式類型為iPhone應用程式,並填一些App的基本資料
5. 進到應用程式設定頁面,記下自己的發佈商ID,等下會用到
可以依據自己的需求設定廣告的文字/背景顏色
6. 下載SDK,準備加到自己的App裡面 (參考 Google AdMob Ads iOS Fundamentals)
解壓縮 googleadmobadssdkios.zip
把 header file 與 library 加到自己的專案
加入額外的 library reference:AudioToolbox、MessageUI、SystemConfiguration、CoreGraphics
Import header file 並宣告變數
// Import GADBannerView’s definition from the SDK
#import "GADBannerView.h"
@interface BannerExampleViewController : UIViewController {
// Declare one as an instance variable
GADBannerView *bannerView_;
}
@end
在想放廣告的頁面中增加下面程式碼,並設定廣告出現位置與自己的"發佈商ID"
#import "BannerExampleViewController.h"
@implementation BannerExampleViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Create a view of the standard size at the bottom of the screen.
bannerView_ = [[GADBannerView alloc]
initWithFrame:CGRectMake(0.0,
self.view.frame.size.height -
GAD_SIZE_320x50.height,
GAD_SIZE_320x50.width,
GAD_SIZE_320x50.height)];
// Specify the ad's "unit identifier." This is your AdMob Publisher ID.
bannerView_.adUnitID = MY_BANNER_UNIT_ID;
// Let the runtime know which UIViewController to restore after taking
// the user wherever the ad goes and add it to the view hierarchy.
bannerView_.rootViewController = self;
[self.view addSubview:bannerView_];
// Initiate a generic request to load it with an ad.
[bannerView_ loadRequest:[GADRequest request]];
}
- (void)viewDidUnload {
[bannerView_ release];
}
- (void)dealloc {
[super dealloc];
}
@end
7. 用模擬器跑跑看
8. 驗證廣告收益
(還沒有上架,所以還沒辦法驗證XD)
參考資料
Google AdMob for Android » 蛙齋
e68Club 漁郎工坊 - 數位生活札記: 【分享】- AdMob 付款到 PayPal 並提領到「台灣的銀行」 全記錄



2E0386B862
回覆刪除hacker kirala
hacker kiralama
tütün dünyası
-
-