簡單來說就是一個廣告容器,讓你可以依據自己設定的百分比來播放各家廣告。你可能想知道哪種類型的廣告收益較大,較容易受到使用者點閱,藉由AdWhirl就可以統計出來。
我們先試著把AdMob整合到AdWhirl裡:
在開始之前請先參考:在 iOS App 加入 AdMob 廣告,把AdMob先申請起來
1. 申請AdWhirl
填寫一些基本資料
2. 加入Application
設定App的名字、URL、背景顏色。
3. 加入自己的AdMob Key並設定曝光比例
4. 下載AdWhirl SDK
目前最新的版本為 AdWhirl 3.1.1
5. 把SDK裡面的 AdWhirl 與 TouchJSON 加進App (原本AdMob的SDK也要留著)
註:記得App不要打開ARC (Automatic Reference Counting),否則會跟AdWhirl的source code相衝,除非你要手動關閉特定file的ARC。
7. 加入library reference:AddressBook、AudioToolbox、AVFoundation、CoreLocation、libsqlite3、libz、MapKit
(記得原本AdMob用到的也要留著)
8. 呈現廣告在View裡面
在.h 檔中 Import header file、加入AdWhirlDelegate、宣告變數、設定變數類型
#import <UIKit/UIKit.h>
#import "AdWhirlView.h"
#import "AdWhirlDelegateProtocol.h"
@class AdWhirlView;
@interface DataViewController : UIViewController <AdWhirlDelegate> {
AdWhirlView *adView;
}
...(Skip)
@property (nonatomic, retain) AdWhirlView *awView;
@end
在.m 檔中去載入AdWhirl View,並Implement兩個delegate
- (void)viewDidLoad
{
[super viewDidLoad];
self.awView = [AdWhirlView requestAdWhirlViewWithDelegate:self];
self.adView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin;
[self.view addSubview:self.awView];
}
- (NSString *)adWhirlApplicationKey
{
return YOUR_APPLICATION_SDK_KEY;
}
- (UIViewController *)viewControllerForPresentingModalView
{
return self;
}
- (void)dealloc
{
self.awView.delegate = nil;
self.awView = nil;
[super dealloc];
}
Application SDK Key的位置
9. 跑跑看
後續
若有其他的廣告,也可以比照相同的方式加進來,每個廣告整合的方式有些不同,可以參考官方文件的第四點 Ad Networks
參考資料
AdWhirl iOS SDK Setup - 官方文件
ADWhirl使用指南 - 棒槌网@Android开发论坛 - Powered by phpwind
AdWhirl with AdMob by Google
AdWhirl SDK 3.0 (iOS) 設置及連接AdMob








82B70632DA
回覆刪除x takipçi
bella modern swivel accent chair
A3EFD329E3
回覆刪除Whatsapp Görüntülü Show Güvenilir
Görüntülü Sex
Telegram Görüntülü Show Grupları