【发布时间】:2020-11-06 17:30:10
【问题描述】:
我的应用上线已经快一周了,但我的实时 Google 广告根本没有展示。
我已经尝试仔细检查我能想到的所有内容,例如确保应用 ID 和广告 ID 正确,但我没有运气。
我有以下 2 个函数来加载和展示广告
public func loadAd() {
interstitial = GADInterstitial(adUnitID: "ca-app-pub-3228561607874346/1546949023") //Live Ad 2
let request = GADRequest()
interstitial.load(request)
}
public func showAd() {
if (interstitial.isReady) {
interstitial.present(fromRootViewController: self)
loadAd()
} else {
print("Ad wasn't ready")
}
}
我尝试使用 Google 教程页面上提供给我的测试广告 ID 使用测试广告运行它,这似乎工作正常,但不是我的 Live Ad。
唯一标记或引起我注意的是控制台正在打印:
[I-ACS023136] 配置没有有效的 Google 应用 ID。
和
[I-ACS034010] 交易失败
但就像我说的,我在 info.plist 文件中仔细检查了我的配置,一切似乎都很好。
有超过 200 个请求和 0% 的匹配率。我只是不知道它会是什么。
【问题讨论】:
-
这个错误看起来不像 admob。您的项目中是否有 crashlytics? Admob 错误将显示此链接中提到的代码developers.google.com/android/reference/com/google/android/gms/…
-
您是否按照developers.google.com/admob/ios/… 中的说明添加了 GADApplicationIdentifier 和 SKAdNetworkIdentifier?