0

我试图在我的 libgdx android 应用程序中实现 MoPub 插页式广告。

当我在 MoPubInterstitial() 构造函数中传递了错误的 ID 时,侦听器中的 onInterstitialFailed() 方法被正确调用,但是当我传递正确的 ID 时,没有任何反应。onInterstitialLoaded() 最终应该被调用,但事实并非如此。MoPubInterstitial.isReady() 永远不会是真的。

我错过了什么吗?我不知道,我应该粘贴我的代码的哪一部分。我没有想法,如何调试这个。

有什么建议么?

4

1 回答 1

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();
            }


        }
    }); 

这些都是我为使它工作而采取的所有步骤。如果您有任何问题,请告诉我。

于 2014-10-21T17:38:25.923 回答