我用Xcode(swift)製作了一個應用程序,並且我在應用中實施了AdMob插頁式廣告,但我知道要顯示廣告的唯一方法是點擊按鈕,廣告會顯示想要在沒有任何按鈕點擊的情況下在webView中展示廣告,就像在某人在幾秒鐘後向下滾動廣告就會彈出一樣。那可能嗎?顯示無按鈕的AdMob插頁式廣告點擊ios
這是什麼我目前使用的
var interstital: GADInterstitial!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
interstital = GADInterstitial(adUnitID: "")
let request = GADRequest()
interstital.load(request)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func Ad(_ sender: Any) {
if (interstital.isReady) {
interstital.present(fromRootViewController: self)
interstital = CreateAd()
}
}
func CreateAd() -> GADInterstitial {
let interstital = GADInterstitial (adUnitID: "")
interstital.load(GADRequest())
return interstital
}
您好先生,但我看到的錯誤,不能轉換類型的值「Timeinterval.Type」(又名「Double.Type)預期的參數類型‘’一個時間間隔」(又名「雙') –
首先感謝我遲到的回覆。我看到我忘記更新最後一行,現在應該可以解決問題。 – Eric