使用swift集成移动广告聚合平台
生活随笔
收集整理的這篇文章主要介紹了
使用swift集成移动广告聚合平台
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
第一步:注冊(cè)賬號(hào)
首先你得上KeyMob官網(wǎng)注冊(cè)賬號(hào),由KeyMob移動(dòng)廣告聚合平臺(tái)提供給你的ID與Key。
第二步:下載 KeyMob SDK
a.導(dǎo)入swift項(xiàng)目?? b.解壓KeyMob SDK 文件? c.在storyboard中添加一塊view,并設(shè)置好布局 d.選擇Class
?
第三步:編輯代碼
import UIKit
Import Google Mobile Ads
Class? viewcontroller:UIViewController{
@IBoutlet weak? var? bannerView:GADBannerView!
Override func viewDidLoad(){
super.viewDidLoad()
bannerView.adUnitId=“ca-app-pub-706657930853688714815911455”
bannerView.rootViewController=self
self.view.addSubView(bannerView)
Var? request:GADRequest=GADRequest()
request.testDevices={“”}
bannerView.loadRequest(request)
}
Override func didReceivwMemoryWarning(){
super.didReceiveMemoryWarning()
}
}
import UIKitimport GoogleMobileAds
class ViewController: UIViewController {
?@IBOutlet weak var bannerView: GADBannerView!
?override func viewDidLoad() {
?super.viewDidLoad()
?// Do any additional setup after loading the view, typically from a nib.
bannerView.adUnitID = "你的廣告ID"
? bannerView.rootViewController = self
? self.view.addSubview(bannerView)
? var request:GADRequest = GADRequest()
? equest.testDevices = [""]
? bannerView.loadRequest(request)
??????????? }
?override func didReceiveMemoryWarning() {
?super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
第四步:測試廣告
KeyMob移動(dòng)廣告聚合平臺(tái):是專門為專業(yè)的移動(dòng)應(yīng)用廣告管理工具,支持國內(nèi)外多家移動(dòng)廣告聚合平臺(tái)自由轉(zhuǎn)換(包括:果合、芒果、抓貓、Adview等)。KeyMob在幫助開發(fā)者輕松集成多家移動(dòng)廣告聚合平臺(tái)的同時(shí),應(yīng)用交叉推廣,大幅提升廣告填充率,實(shí)現(xiàn)廣告收入最大化。
首先你得上KeyMob官網(wǎng)注冊(cè)賬號(hào),由KeyMob移動(dòng)廣告聚合平臺(tái)提供給你的ID與Key。
第二步:下載 KeyMob SDK
a.導(dǎo)入swift項(xiàng)目?? b.解壓KeyMob SDK 文件? c.在storyboard中添加一塊view,并設(shè)置好布局 d.選擇Class
?
第三步:編輯代碼
import UIKit
Import Google Mobile Ads
Class? viewcontroller:UIViewController{
@IBoutlet weak? var? bannerView:GADBannerView!
Override func viewDidLoad(){
super.viewDidLoad()
bannerView.adUnitId=“ca-app-pub-706657930853688714815911455”
bannerView.rootViewController=self
self.view.addSubView(bannerView)
Var? request:GADRequest=GADRequest()
request.testDevices={“”}
bannerView.loadRequest(request)
}
Override func didReceivwMemoryWarning(){
super.didReceiveMemoryWarning()
}
}
import UIKitimport GoogleMobileAds
class ViewController: UIViewController {
?@IBOutlet weak var bannerView: GADBannerView!
?override func viewDidLoad() {
?super.viewDidLoad()
?// Do any additional setup after loading the view, typically from a nib.
bannerView.adUnitID = "你的廣告ID"
? bannerView.rootViewController = self
? self.view.addSubview(bannerView)
? var request:GADRequest = GADRequest()
? equest.testDevices = [""]
? bannerView.loadRequest(request)
??????????? }
?override func didReceiveMemoryWarning() {
?super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
第四步:測試廣告
KeyMob移動(dòng)廣告聚合平臺(tái):是專門為專業(yè)的移動(dòng)應(yīng)用廣告管理工具,支持國內(nèi)外多家移動(dòng)廣告聚合平臺(tái)自由轉(zhuǎn)換(包括:果合、芒果、抓貓、Adview等)。KeyMob在幫助開發(fā)者輕松集成多家移動(dòng)廣告聚合平臺(tái)的同時(shí),應(yīng)用交叉推廣,大幅提升廣告填充率,實(shí)現(xiàn)廣告收入最大化。
總結(jié)
以上是生活随笔為你收集整理的使用swift集成移动广告聚合平台的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 藏在耳机里的小东西——蓝牙天线
- 下一篇: BFS简单搜索--POJ 2243