簡體   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