1
我有这样的代码:如何显示AdMob插页一个时间上的后退按钮自来水
func createAndLoadInterstitial() {
interstitial = GADInterstitial(adUnitID: "ca-app-pub-xxxxxxxxxx/xxxxx")
interstitial.delegate = self
let request = GADRequest()
interstitial.loadRequest(request)
}
override func viewDidAppear(animated: Bool) {
if (interstitial.isReady && showAd) {
showAd = false
// print("iterstitialMain is ready")
interstitial.presentFromRootViewController(self)
self.createAndLoadInterstitial()
}
else {
showAd = true
}
}
和它的作品。但每次用户点击后退按钮时都会显示一个广告。
我想仅在用户点击后退按钮时显示广告一次。相反,在一段时间后展示广告会更好吗?例如,每5分钟?
谢谢!这对我帮助很大。 – user6023982