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