2014-08-29 82 views
0

我試圖在我的libgdx android應用程序中實現MoPub插頁式廣告。MoPub android sdk onInterstitialLoaded從未調用

當我在MoPubInterstitial()構造函數中傳入一個錯誤的ID時,偵聽器中的onInterstitialFailed()方法被正確調用,但是當我傳遞正確的ID時,什麼都不會發生。 onInterstitialLoaded()應該最終調用,但它不是。 MoPubInterstitial.isReady()永遠不會成立。

我錯過了什麼嗎? 我不知道,我應該粘貼哪部分代碼。我沒有想法,如何調試。

有什麼建議嗎?

回答

0
private static final String MoPubInterstitialID = "xxxxxxxxxxxxx"; 
private MoPubInterstitial moPubInterstitial; 
moPubInterstitial = new MoPubInterstitial(this, MoPubInterstitialID); 
moPubInterstitial.setInterstitialAdListener(this); 
    moPubInterstitial.load(); 
    moPubInterstitialButton.setOnClickListener(new OnClickListener() { 
     public void onClick(View v) { 
      Log.d("MoPub", "Interstitial button clicked"); 

      if (moPubInterstitial.isReady()) 
      { 
       Log.d("MoPub", "Interstitial is Ready"); 
       moPubInterstitial.show(); 
       Log.d("MoPub", "Interstial Shown"); 
       moPubInterstitial.forceRefresh(); 
      } 


     } 
    }); 

這些都是我爲使其工作所採取的所有步驟。如果您有任何問題,請告訴我。