2017-05-08 97 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安裝。