2017-05-08 99 views
1

我知道这类问题已经被问了很多,但我已经尝试了一切,并且无法找到正在发生的事情。Admob RewardedVideo via Firebase

我没有使用中介,也没有显示插页式广告的麻烦。下面是我的配置:

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. 

任何帮助将是巨大的。在此先感谢,

//编辑

莫非与装置大小有关吗?我已经在模拟器上进行了测试,并且它工作正常,但在iPhone 7上,结果如上所示。任何人都可以证实此事

+0

您是否发现此问题? –

+0

嗨@SamBing不知道发生了什么,但我已经能够在我尝试过的每款设备中获得奖励广告,除了iPhone 7外...不知道这是否是原因,但似乎是这样... –

+0

我遇到了测试广告单元ID的问题,我创建了我自己的,现在一切正常。主要在iPhone 7 Plus上测试并且工作正常,所以我不确定。 –

回答

0

请确保正确安装Adapter SDK,Firebase SDK并将它们正确链接到BuildPhases - > Link Binary with Libraries。还要添加文档中提到的搜索路径。该错误意味着要么没有广告显示,要么收到错误的广告。我用sample apps检查了您的广告单元ID,一切正常。再次检查您的实施和Pod安装。