我用自己註冊的「廣告單元編號」: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.
}
}