現在它只顯示整個頁面廣告一次。當我回去並再次按下按鈕時,它不顯示。我希望它顯示加班我的按鈕被點擊。我已將我的AdMob連接到我的Firebase項目。如何讓我的插頁式廣告展示超時按鈕被點擊
class FirstViewController: UIViewController, UIAlertViewDelegate {
var interstitial: GADInterstitial!
@IBAction func loadAd(_ sender: Any) {
if (interstitial.isReady){
interstitial.present(fromRootViewController: self)
}
}
override func viewDidLoad() {
interstitial = GADInterstitial(adUnitID: "ca-app-pub-11111111/9758796532")
let request = GADRequest()
interstitial.load(request)
super.viewDidLoad()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
只做一件事情創建viewwiiappear的GADInterstitial請求()你的問題解決 –