我正在使用 Swift2 和 Xcode7 开发一个 iOS 应用程序。我正在尝试实现 AdMob,但它没有显示我的插页式广告。
override func viewDidLoad() {
super.viewDidLoad()
_interstitial = createAndLoadInterstitial()
}
func createAndLoadInterstitial()->GADInterstitial {
let interstitial = GADInterstitial(adUnitID: "interstitial_ID")
let gadRequest:GADRequest = GADRequest()
gadRequest.testDevices = ["test device id"]
interstitial.delegate = self
interstitial?.loadRequest(gadRequest)
return interstitial!
}
func interstitialDidReceiveAd(ad: GADInterstitial!) {
_interstitial?.presentFromRootViewController(self)
}
func interstitial(ad: GADInterstitial!, didFailToReceiveAdWithError error: GADRequestError!) {
print(error.localizedDescription)
}
func interstitialDidDismissScreen(ad: GADInterstitial!) {
_interstitial = createAndLoadInterstitial()
}
我收到此错误:
Request Error: No ad to show.
最佳答案
请求错误:没有要显示的广告。
表示您的请求已成功,但 Admob 目前没有针对您的设备展示的广告。确保始终有广告展示的最佳方式是使用中介,这样未完成的请求就会进入另一个广告网络。 Admob 提供了很好的机制来做到这一点。
关于ios - AdMob 插页式错误 "Request Error: No ad to show",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32822987/