import UIKit
import GoogleMobileAds
class ViewController: UIViewController, GADBannerViewDelegate {
override func viewDidLoad() {
super.viewDidLoad()
let bannerView: GADBannerView = GADBannerView(adSize: kGADAdSizeBanner)
bannerView.frame.origin = CGPointMake(0, self.view.frame.size.height -bannerView.frame.height - 49)
bannerView.frame.size = CGSizeMake(self.view.frame.width, bannerView.frame.height)
bannerView.adUnitID = "ca-app-pub-xxxxxxxxxxx/xxxxxxxxx"
bannerView.delegate = self
bannerView.rootViewController = self
let gadRequest:GADRequest = GADRequest()
// 테스트
gadRequest.testDevices = [kGADSimulatorID]
bannerView.loadRequest(gadRequest)
self.view.addSubview(bannerView)
}
}
bannerView.adUnitID = "ca-app-pub-xxxxxxxxxxx/xxxxxxxxx"
bannerView.delegate = self
bannerView.rootViewController = self
let gadRequest:GADRequest = GADRequest()
// 테스트
gadRequest.testDevices = [kGADSimulatorID]
bannerView.loadRequest(gadRequest)
self.view.addSubview(bannerView)
}
}
댓글 없음:
댓글 쓰기