【发布时间】:2015-03-04 13:41:31
【问题描述】:
这是我用来确定 adMob 插页式广告是否可以显示的代码。
func presentInterstitial() {
if showAds == true {
if let isReady = interstitial?.isReady {
println("isReady is true")
interstitial?.presentFromRootViewController(self)
} else {
println("ad not ready")
}
}
}
即使我切断了网络,它也总是会恢复,因此不可能加载任何广告。
【问题讨论】:
-
使用 AdMob 框架提供的委托方法。 developers.google.com/mobile-ads-sdk/docs/admob/ios/ad-events
-
@Daniel Storm:我正在使用代表。
标签: ios xcode swift admob interstitial