我知道这类问题被问了很多,但我已经尝试了所有的方法,却找不到发生了什么。
我没有使用调解,我没有问题显示间隙。以下是我的配置:
class MainContainerViewController: UIViewController, GADInterstitialDelegate, GADRewardBasedVideoAdDelegate {
var rewardBasedVideo: GADRewardBasedVideoAd?
override func viewDidLoad() {
super.viewDidLoad()
...
rewardBasedVideo = GADRewardBasedVideoAd.sharedInstance()
rewardBasedVideo?.delegate = self
let request = GADRequest()
request.testDevices = ["b8d6d8f423b67dc1855d953466503d0d"]
rewardBasedVideo?.load(request, withAdUnitID: "ca-app-pub-3872067921404234/2000937302")
}
func rewardBasedVideoAd(_ rewardBasedVideoAd: GADRewardBasedVideoAd, didFailToLoadWithError error: Error) {
NSLog("didFailToLoad \(error.localizedDescription)")
}
}
我试过加载AdUnitID进行测试,但没有成功,每次尝试加载新的奖励视频时,日志都显示:
<Google> Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in the 'Other Linker Flags' setting of your build target.
didFailToLoad No ad returned from any ad server.
任何帮助都很好。提前谢谢你,
//编辑
是否与设备尺寸有关?我已经在模拟器上测试过了,它运行得很好,但是在iphone7上,结果是上面显示的。有人能证实吗???
最佳答案
确保正确安装适配器SDK和Firebase SDK,并在BuildPhases->link Binary with Libraries中正确链接它们。同时添加文档中提到的搜索路径。这个错误意味着要么没有广告显示,要么你收到了一个错误的广告。我用sample apps检查了你的广告单元ID,一切正常。再次检查您的实现和Pod安装。