- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个 GADInterstitial
的实现
class AdsManager {
let adsAppId = MY_ID
let fullScreenAdUnitId = MY_ID
static let manager: AdsManager = AdsManager()
private var interstitial: GADInterstitial!
private init () {
createAndLoadInterstitial()
}
func presentInterstitial(fromViewController viewController: UIViewController) {
if interstitial.isReady {
interstitial.present(fromRootViewController: viewController)
}
else {
print("Interstitial is not ready")
}
createAndLoadInterstitial()
}
private func createAndLoadInterstitial() {
//TODO: replace test ad unit id with production
interstitial = GADInterstitial(adUnitID: MY_ID)
interstitial.load(GADRequest())
}
}
func touchedButton(_ sender: UIButton) {
AdsManager.manager.presentInterstitial(fromViewController: self)
}
AdsManager
中犯了一个错误。 ?也许 Firebase 实现错误?
最佳答案
数量GADUIKitWebView
的取决于所呈现的广告类型。视频、图片和文字广告都有不同的布局。根据使用的内存量,我认为它是正确的。
查看交互式 GADInterstitial
的层次结构广告:
除此之外,您的实现确实存在问题。您的问题出在此功能中:
func presentInterstitial(fromViewController viewController: UIViewController) {
if interstitial.isReady {
interstitial.present(fromRootViewController: viewController)
}
else {
print("Interstitial is not ready")
}
createAndLoadInterstitial() // PROBLEM
}
createAndLoadInterstitial()
进入
else
所以你只加载另一个
GADInterstitial
当你真正需要的时候。例如:
func presentInterstitial(fromViewController viewController: UIViewController) {
if interstitial.isReady {
interstitial.present(fromRootViewController: viewController)
}
else {
print("Interstitial is not ready")
createAndLoadInterstitial()
}
}
GADInterstitial
delegate methods并加载另一个
GADInterstitial
只有在它关闭屏幕后。例如:
/// Called just after dismissing an interstitial and it has animated off the screen.
func interstitialDidDismissScreen(_ ad: GADInterstitial) {
print("interstitialDidDismissScreen")
createAndLoadInterstitial()
}
关于ios - View 层次结构中的 GADInterstitial 重复项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43350516/
我刚刚将 Google Mobile Ads SDK 升级到 8.0 版,但出现了以下错误: Cannot find type 'GADInterstitial' in scope 我还将这段代码添加
我的插页式广告过于频繁地弹出,我遇到了问题。全屏广告在每次游戏结束后都会出现,这意味着每次玩家输了都会弹出广告,我觉得这会很烦人。有没有办法在每次失败后或每 2 或 3 个游戏结束后阻止这种情况发生?
在我的应用程序中,我使用了 GADInterstitial,它完美地显示了广告,但它每次都显示相同的 AdMob 默认广告。这是我的代码: self.interstitialAd = GADInter
我有一个 GADInterstitial 的实现 class AdsManager { let adsAppId = MY_ID let fullScreenAdUnitId = MY
如何在ios项目中显示GADInterstitial?我收到错误“请求错误:没有要显示的广告”,但 admob 正在我的另一个项目中工作。 // ViewController.h #import
我想知道是否有办法在全屏 UICollectionViewCell 上呈现 GADInterstitial。我查找了 GADInterstitial 委托(delegate)方法,并且 interst
我正在使用 this guide. 在我的 iOS 模块中实现 admob 我有一个 View Controller ,我的插页式广告像这样初始化 @CustomClass public class
我计划将 AdMob 插页式广告添加到我的应用中。一切正常,但我想更改广告外观的动画。默认情况下,广告单元从下向上显示。我想改变动画以溶解或完全关闭它。有这样的机会吗? 我有什么: GADInters
当我的应用程序的用户点击某个按钮转到某个 ViewController 时,我试图展示一个 GADInterstitial 广告。在新的 ViewController 的 viewDidLoad 方法
我正在尝试将 AdMob 的插页式广告集成到我的 iOS 中,但即使一切看起来都正常,我也没有触发任何插页式委托(delegate)方法(包括失败)。我已将我的广告设置为插页式广告并且我的广告单元
从 admobs 显示 GADInterstitial 后我遇到了问题。 我要做的是: 使用 presentFromRootViewController 打开 GADInterstitial: 关闭它
我是一名优秀的程序员,十分优秀!