我用自己注册的“广告单元编号”:ca-app-pub-3827344472857629/2471452395
在以下的范例中无法显示出测试的广告,执行画面是一片空白。
但用官方范例提供的就可以跑出测试的广告划面,是我漏掉什么步骤吗 ?
我是在10/7注册的广告单元编号,需要等待几天才能吗?
import UIKit
import GoogleMobileAds
class ViewController: UIViewController, GADInterstitialDelegate, UIAlertViewDelegate {
@IBOutlet var bannerView: GADBannerView!
override func viewDidLoad() {
super.viewDidLoad()
//ca-app-pub-3827344472857629/2471452395 myAdUnitId
//ca-app-pub-3940256099942544/2934735716 sample
bannerView.adUnitID = "ca-app-pub-3827344472857629/2471452395"
bannerView.rootViewController = self
self.view.addSubview(bannerView)
bannerView.loadRequest(GADRequest())
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}