我已使用以下代码将 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 设备上运行我的应用程序后的日志:-
最佳答案
您必须按照 google documentation 使用如下测试 ID 来测试您的 Google 广告.
插页式测试 ID
ca-app-pub-3940256099942544/4411468910
添加测试 ID 并重试。
关于ios - 无法在我的 iOS 应用程序上显示 Google 插页式广告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65047196/