我正在GADInterstitialAd
使用 Swift 中的 present 在我的 iOS 应用程序中显示。下面是我用来展示广告的代码。
func showAd() {
if self.interstitialAd.isReady {
self.interstitialAd.present(fromRootViewController: self)
}
}
我正在屏幕上运行一个计时器,一旦广告从屏幕上消失,我想暂停并恢复它。谁能告诉我如何实现这个?我检查interstitialWillDismissScreen
过,但似乎我需要让我的自定义类从GADInterstitialDelegate
. 截至目前,我直接使用var interstitialAd: GADInterstitial!
,我想知道是否有任何方法可以检查广告何时打开和关闭屏幕?