ios - 无法在我的 iOS 应用程序上显示 Google 插页式广告

标签 ios swift admob

我已使用以下代码将 google AdMob 插页式广告集成到我的 iOS 应用程序中:-

import GoogleMobileAds

class ViewController: UIViewController, GADInterstitialDelegate {

    var interstitial: GADInterstitial!

    override func viewDidLoad() {
        super.viewDidLoad()
    
        interstitial = GADInterstitial(adUnitID: "")
        interstitial.delegate = self
        let request = GADRequest()
        interstitial.load(request)

    }

    // Google Ads

    func interstitialDidReceiveAd(_ ad: GADInterstitial) {
    
        interstitial.present(fromRootViewController: self)
    
    }

}

当我运行测试广告时,我能够看到插页式广告!但是,将测试 ID 替换为我的插页式广告单元 ID 后,我无法在 iOS 应用程序上看到实时插页式广告。有人可以帮我解决这个问题吗?谢谢:)

这些是在我的 iOS 设备上运行我的应用程序后的日志:-

enter image description here

最佳答案

您必须按照 google documentation 使用如下测试 ID 来测试您的 Google 广告.

插页式测试 ID

ca-app-pub-3940256099942544/4411468910

添加测试 ID 并重试。

关于ios - 无法在我的 iOS 应用程序上显示 Google 插页式广告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65047196/

相关文章:

ios - 使用仅适用于 iOS 7 的应用程序处理 Core Data 和 iCloud 的正确方法

ios - Swift 3 标签栏禁用标签

objective-c - 多个UIBarButton项目

ios - 如何在 SwiftUI 中更改每个 View 的状态栏文本颜色?

ios - 我如何在第 2 代 SKSpriteNode 之间等待?

Android:使用 MoPub 中介但 Admob 报告展示次数为 0?

iphone - popToRootViewController 以及如何在此处更新信息

xcode - 无法使用类型为 'getDataInBackgroundWithBlock' 的参数列表调用 '((NSData!, NSError!) -> Void)'

android - Admob 在免费增值应用上的新用户流

Android Studio AdMob 与 Google Play 服务的集成