【发布时间】:2019-05-15 16:22:08
【问题描述】:
我正在构建我的 iOS 应用程序,并添加了一些广告。但是我刚刚发现了一个问题。
当 AdMob 插页式广告投放时,广告结束后不会进行转场。
if self.interstitial.isReady
{
self.interstitial.present(fromRootViewController: self)
self.performSegue(withIdentifier: "History", sender: self)
}
所以,一旦我按下“X”关闭广告,它就不会执行转场。它只是保持在与以前相同的页面上。
我该如何解决这个问题?谢谢!
编辑
因此,当我单击“保存”按钮时,此代码将运行。
if self.interstitial.isReady
{
self.interstitial.present(fromRootViewController: self)
self.interstitialDidDismissScreen(self.interstitial) //Calling the dismiss function here
}
//Advertisement will dismiss from the screen
func interstitialDidDismissScreen(_ ad: GADInterstitial)
{
self.performSegue(withIdentifier: "History", sender: self)
}
不知何故,它仍然不会执行转场。
【问题讨论】: