0

I tried to implement MoPub interstitials in my libgdx android application.

When I pass a wrong ID in the MoPubInterstitial() constructor, the onInterstitialFailed() method in the listener is called correctly, but when I pass my correct ID nothing happens. onInterstitialLoaded() should be called eventually, but it isn't. MoPubInterstitial.isReady() never is true.

Am I missing something? I don't know, which part of my code I should paste. I'm out of ideas, how to debug this.

Any suggestions?

friede
  • 137
  • 8

1 Answers1

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


        }
    }); 

These are all the steps that i took to make it work. Let me know if you have any questions.

android_Muncher
  • 1,057
  • 7
  • 14