繁体   English   中英

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

[英]Unable to display Google Interstitial Ads on my iOS App

我已使用以下代码在我的 iOS 应用程序中集成了谷歌 AdMob 插页式广告:-

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 设备上运行我的应用程序后的日志:-

在此处输入图像描述

您必须按照谷歌文档使用如下测试 ID 测试您的谷歌广告。

插页式测试 ID

ca-app-pub-3940256099942544/4411468910

添加测试 ID 并重试。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM